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

From: Date: Sat, 15 Oct 2011 03:05:50 +0000
Subject: Re: move_uploaded_file() does not return any value or warning
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-315308@lists.php.net to get a copy of this message
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/

« previous php.general (#315308) next »