RE: [PHP-DB] problemhandling form variables
| From: | Rick Emery | Date: | Tue, 18 Sep 2001 15:53:24 +0000 |
| Subject: | RE: [PHP-DB] problemhandling form variables | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12547@lists.php.net to get a copy of this message | ||
When you printed the string $imgupload, what were its contents?
-----Original Message-----
From: Todd Moy [mailto:metonym@metonym.org]
Sent: Tuesday, September 18, 2001 12:40 PM
To: php-db@lists.php.net
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: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net