problemhandling form variables
| From: | Todd Moy | Date: | Tue, 18 Sep 2001 17:40:01 +0000 |
| Subject: | problemhandling form variables | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12546@lists.php.net to get a copy of this message | ||
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
*/