phpwannabe25 Posted August 25, 2009 Share Posted August 25, 2009 I am wondering if this error message is correct, syntax wise? basiscally, if the photo is not moved to the server, the error message will appear!?? //Writes the photo to the server if!(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } Link to comment https://forums.phpfreaks.com/topic/171772-error-message/ Share on other sites More sharing options...
Bricktop Posted August 25, 2009 Share Posted August 25, 2009 Hi phpwannabe25, It should read: //Writes the photo to the server if(!move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } You just needed to move the ! inside the opening bracket of the if statement. Link to comment https://forums.phpfreaks.com/topic/171772-error-message/#findComment-905768 Share on other sites More sharing options...
phpwannabe25 Posted August 25, 2009 Author Share Posted August 25, 2009 Thanks very much! Link to comment https://forums.phpfreaks.com/topic/171772-error-message/#findComment-905788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.