computermax2328 Posted June 13, 2012 Share Posted June 13, 2012 Hello again, I have something strange going on. I have a form that you can upload a photo with and on my development computer. It uploads the photo to a folder and stores the path name in a mysql database. I upload this to my Bluehost server and now it stores the photo, but wont pass the $name variable. It will pass the path but forget about the $name variable. I keep getting ../photos/ on my database table when I should be getting ../photos/$name variable. Any tips? I messed around with the php.ini file a little bit. Increased max file upload size and the max post size. Quote Link to comment https://forums.phpfreaks.com/topic/264131-form-not-passing-file-name/ Share on other sites More sharing options...
Mahngiel Posted June 13, 2012 Share Posted June 13, 2012 post relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/264131-form-not-passing-file-name/#findComment-1353592 Share on other sites More sharing options...
computermax2328 Posted June 13, 2012 Author Share Posted June 13, 2012 <?php $name = ($_FILES['pic']['name']); $tmp_name = ($_FILES['pic']['tmp_name']); if ($name){ $location = "../photos/$name"; move_uploaded_file($tmp_name, $location); } else { echo "please click back and select a file"; } if (empty($name)) { echo "No file submitted. Please click back and select a file."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/264131-form-not-passing-file-name/#findComment-1353593 Share on other sites More sharing options...
Pikachu2000 Posted June 13, 2012 Share Posted June 13, 2012 Echo $_FILES['pic']['error'] to see if there are any upload errors. Quote Link to comment https://forums.phpfreaks.com/topic/264131-form-not-passing-file-name/#findComment-1353596 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.