in image upload code i found these lines... if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } PHP: Except this part, i understand every thing... any body explain this part to me.., what is $_FILES["file"]["error"], why used > 0 and what echo will retuens....! i am very fresher so please tell me clearly Thanks friends..,
Since PHP 4.2.0, PHP returns an appropriate error code along with the file array. The error code can be found in the error segment of the file array that is created during the file upload by PHP. In other words, the error might be found in $_FILES['file']['error']. If $_FILES['file']['error'] is 0 - this means file was uploaded successfully, no errors. Source: http://www.php.net/manual/en/features.file-upload.errors.php
But $_FILES["file"]["error"] > 0 the error will be executed.. according to the code i provided...! as echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; But you said If $_FILES['file']['error'] is 0 - this means file was uploaded successfully, no errors.
You're right. If $_FILES["file"]["error"] > 0 your script will display error code: echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; Code (markup): If there was no errors during file upload, the variable $_FILES["file"]["error"] will be set to zero, meaning your code will not display error code. Isn't it obvious?
Its says that if the value is greater that 0 it will return a Error Number Else (if equal to 0) means Upload successful
Ohh ya ..., thank you roopajyothi, and Sergey Popov..! Now i came to know exactly..., thanks once again..!
Welcome! Just try to know the basics of PHP Have a look here for resources http://forums.digitalpoint.com/showthread.php?t=1780359