note 9990 added to Uploading multiple files
| From: | mark at dvo dot info dot com dot ph | Date: | Tue, 05 Dec 2000 14:03:10 +0000 |
| Subject: | note 9990 added to Uploading multiple files | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8417@lists.php.net to get a copy of this message | ||
hey can anyone tell me what's wrong with my code?
here's my html form:
<input type="file" name="img1" size="30">
<input type="file" name="img2" size="30">
<input type="file" name="img3" size="30">
============================
here's my exact php code:
<?
for($i=1;$i<4;$i++)
{
$varname = "img".$i;
$img = "$".$varname;
$img_name = $img."_name";
if($img_name != "") {
copy("$img", "$img_name")
or die ("Coudn't copy the file");
}
else {
die ("No input file specified");
}
}
?>
i got errors like these:
Warning: Unable to open '$img1' for reading: No such file or directory in
/home/staff/mark/www/uploader/uploader.php on line 8
Warning: Unable to open '$img2' for reading: No such file or directory in
/home/staff/mark/www/uploader/uploader.php on line 8
Warning: Unable to open '$img3' for reading: No such file or directory in
/home/staff/mark/www/uploader/uploader.php on line 8
it seems that it can't find the files that are being uploaded.
pls help me......
http://www.php.net/manual/feature-fileupload.multiple.php