GarryOne Posted June 9, 2011 Share Posted June 9, 2011 <?php include('utilities.php'); $need_file='data/upload/file.txt'; $need_ext='txt'; $dir = 'data/upload'; if (isset($_FILES['foto']['tmp_name'])) { $tmp_name = $_FILES["foto"]["tmp_name"]; $name = $_FILES["foto"]["name"]; move_uploaded_file($tmp_name, "$dir/$name"); $uploaded = "$dir/$name"; $ext = pathinfo($uploaded,PATHINFO_EXTENSION); if ($ext == $need_ext) { if (file_exists($need_file)) { unlink($need_file); } MOVE_UPLOADED_FILE($uploaded, $need_file); unlink($uploaded); redir('page.php?rs=ok&pag=home'); } else { unlink($uploaded); $_SESSION['error']='<p>Error. Try Again.</p>'; redir('page.php?pag=home'); } } else { $_SESSION['error']='<p>Upload File</p>'; redir('page.php?pag=home'); } ?> I'm sure that the problem is on function move_uploaded_file where I highlighted, but I don't found it. Quote Link to comment https://forums.phpfreaks.com/topic/238876-php-problem-with-function-move_uploaded_file/ Share on other sites More sharing options...
kenrbnsn Posted June 9, 2011 Share Posted June 9, 2011 What's the question? You just showed us some code without telling us what's wrong. Ken Quote Link to comment https://forums.phpfreaks.com/topic/238876-php-problem-with-function-move_uploaded_file/#findComment-1227440 Share on other sites More sharing options...
chintansshah Posted June 9, 2011 Share Posted June 9, 2011 php is case-sensitive language use lower case for php function MOVE_UPLOADED_FILE($uploaded, $need_file); Quote Link to comment https://forums.phpfreaks.com/topic/238876-php-problem-with-function-move_uploaded_file/#findComment-1227518 Share on other sites More sharing options...
Psycho Posted June 9, 2011 Share Posted June 9, 2011 php is case-sensitive language use lower case for php function MOVE_UPLOADED_FILE($uploaded, $need_file); Since when is PHP case sensitive? First of all, I assumed the OP changed that line to upper-case to "highlight" it as he stated in his description. Second, PHP is not case sensitive - at least I can run code in alternative cases on my machine with no problems. Quote Link to comment https://forums.phpfreaks.com/topic/238876-php-problem-with-function-move_uploaded_file/#findComment-1227521 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.