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/11 08:35 AM, Simon J Welsh wrote:
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).
My apologies - i forgot to include the $move_uploaded_file = move_uploaded_file($filename, $destination); line.

I saw in the manual that isset() "isset --- Determine if a variable is set and is not NULL" and thought if move_uploaded_file() returns false, the error checking will be triggered.But now i see the sample code in the manual and stand corrected.

So what was happening that $move_uploaded_file was set but empty.My understanding of isset() was wrong.

*
*




[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