LuciBKen Posted June 26, 2007 Share Posted June 26, 2007 Here's my code: <?php // Receiving variables $pfw_ip= $_SERVER['REMOTE_ADDR']; $textfield = addslashes($_POST['textfield']); $textarea = addslashes($_POST['textarea']); $file_Name = $_FILES['file']['name']; $file_Size = $_FILES['file']['size']; $file_Temp = $_FILES['file']['tmp_name']; $file_Mime_Type = $_FILES['file']['type']; $file2_Name = $_FILES['file2']['name']; $file2_Size = $_FILES['file2']['size']; $file2_Temp = $_FILES['file2']['tmp_name']; $file2_Mime_Type = $_FILES['file2']['type']; function RecursiveMkdir($path) { if (!file_exists($path)) { RecursiveMkdir(dirname($path)); mkdir($path, 0777); } } $uploadFile = $file_Name ; if (!is_dir(dirname($uploadFile))) { RecursiveMkdir(dirname($uploadFile)); } move_uploaded_file( $file_Temp , $uploadFile); $file_URL = "http://www.hawaiisoccermag.com/html/video/".$file_Name ; $uploadFile = $file2_Name ; if (!is_dir(dirname($uploadFile))) { RecursiveMkdir(dirname($uploadFile)); } move_uploaded_file( $file2_Temp , $uploadFile); $file2_URL = "http://www.hawaiisoccermag.com/html/video/thumb/".$file2_Name ; //saving record in a text file $pfw_file_name = "videolist.csv"; $pfw_first_raw = "textfield,textarea,file,file2\r\n"; $pfw_values = "$textfield,".str_replace ("\r\n","<BR>",$textarea ).",$file_Name,$file2_Name\r\n"; $pfw_is_first_row = false; if(!file_exists($pfw_file_name)) { $pfw_is_first_row = true ; } if (!$pfw_handle = fopen($pfw_file_name, 'a+')) { die("Cannot open file ($pfw_file_name)"); exit; } if ($pfw_is_first_row) { if (fwrite($pfw_handle, $pfw_first_raw ) === FALSE) { die("Cannot write to file ($pfw_filename)"); exit; } } if (fwrite($pfw_handle, $pfw_values) === FALSE) { die("Cannot write to file ($pfw_filename)"); exit; } fclose($pfw_handle); The script won't upload to the right directory, and returns no errors, I'm completely lost and my deadline is today. Can someone help? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.