[PHP-DB] Re: Subject: Image / file uploader

2004-04-30 Thread Neil Smith [MVP, Digital media]
BTW that line should read "if ($dest =='') " not "if ($dest = '')"

You need 2 equals signs to test for equality, using one you are
setting $dest to an empty string. It's a miracle it ever worked ;-)
Cheers - Neil

if ($dest = '') {
if (move_uploaded_file($source, $dest)) {
echo ("Image and Bio has 
been successfully stored. ");
} else {
echo ("Image could not be 
stored.");
}
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Subject: Image / file uploader

2004-04-30 Thread Neil Smith [MVP, Digital media]
So did you intend for this to happen :

Set $dest="". Check source supplied. Set $dest=$uploadpath.$photo_name;
Check if $dest="". If $dest="" (which it cant be if you supplied an image),
then move the uploaded file (it will never run). Else, echo couldn't store 
image.

You see the problem, yes ?

PS why do you check if ($source != '') twice ? Whats that all about ?


$source = $HTTP_POST_FILES['photo']['tmp_name'];
$photo_name = $HTTP_POST_FILES['photo']['name'];
$dest = '';
if (($source != '') && ($source != '')) {
$dest = $uploadpath.$photo_name;
if ($dest = '') {
if (move_uploaded_file($source, $dest)) {
echo ("Image and Bio has 
been successfully stored. ");
} else {
echo ("Image could not be 
stored.");
}
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php