Jump to content

ERROR message


phpwannabe25

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.