Re: move_uploaded_file() does not return any value or warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/10/2011, at 4:01 PM, Partha Chowdhury wrote:

> Then i set a check for the return value of move-uploaded_file.
>> if(isset ($move_uploaded_file)):
>>               echo ""success;
>>           else:
>>               echo "error in uploading";
>>           endif;
> But it does not print anything !

Assuming you did $move_uploaded_file = move_uploaded_file($filename, $destination);, then isset($move_uploaded_file) will always be true.

isset() just checks if the variable you past to it is set, not if it has a non-false value. You could simply use if(move_uploaded_file($filename, $destination)), or if($move_uploaded_file).
---
Simon Welsh
Admin of http://simon.geek.nz/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux