When you printed the string $imgupload, what were its contents?
-----Original Message-----
From: Todd Moy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 12:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] problemhandling form variables
I have an upload field on a form that is optional for the user. Hence,
they may post an image or not. If not, a default image is assigned. Here
is my logic and the corresponding error:
/*$imgupload is the file field on the form*/
if(!$imgupload){
$imglink=$imgpath.$defaultimg; //assign the path to image
}elseif($imgupload){
copy($imgupload, "project_images/$imgupload_name"); //line 35
$imglink=$imgpath.$imgupload_name; // path to directory
unlink($imgupload); // line 37
}else{
printf("Error saving image...");
}
/* errors
Warning: Unable to open 'none' for reading: No such file or directory in
/home/metonym/public_html/makenewproject.php on line 35
Warning: Unlink failed (No such file or directory) in
/home/metonym/public_html/makenewproject.php on line 37
*/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]