Multiple File Upload not working, HELP!
Posted: Mon Oct 20, 2003 5:15 pm
Hey guys, heres the deal i have 2 pages. admin and admin2.php
Admin.php has a simple form (http://www.everto.net/sexvids/admin.php)
it has 9 upload boxes and comment boxes. Right now im working on the images, each upload box is named userfile[1], userfile[2], userfile[3] etc all the way up to userfile[9]. The form when submitted goes to admin2.php
Here it should loop until it uploads each file, instead the script seems to die and i get a blank screen.
Below is the PHP Source for admin2.php
Any ideas on whats wrong?
$archive_dir = "/images";
for ($counter=1; $counter<10; $counter++)
{
if(isset($WINDIR)) $userfile = str_replace("\\\\","\\", $userfile[$counter]);
$filename = basename($userfile[$counter]_name);
if($userfile_size[$counter] <= 0) die ("$filename is empty.");
if(!@copy($userfile[$counter], "$archive_dir/$filename"))
die("Can't copy $userfile_name to $filename.");
echo "$filename has been successfully uploaded to images/$filename.<BR>";
echo "Filesize: " . number_format($userfile_size) . "<BR>";
echo "Filetype: $userfile_type<BR>";
echo "A List of All Files is at dddd";
}
echo "all done";
Admin.php has a simple form (http://www.everto.net/sexvids/admin.php)
it has 9 upload boxes and comment boxes. Right now im working on the images, each upload box is named userfile[1], userfile[2], userfile[3] etc all the way up to userfile[9]. The form when submitted goes to admin2.php
Here it should loop until it uploads each file, instead the script seems to die and i get a blank screen.
Below is the PHP Source for admin2.php
Any ideas on whats wrong?
$archive_dir = "/images";
for ($counter=1; $counter<10; $counter++)
{
if(isset($WINDIR)) $userfile = str_replace("\\\\","\\", $userfile[$counter]);
$filename = basename($userfile[$counter]_name);
if($userfile_size[$counter] <= 0) die ("$filename is empty.");
if(!@copy($userfile[$counter], "$archive_dir/$filename"))
die("Can't copy $userfile_name to $filename.");
echo "$filename has been successfully uploaded to images/$filename.<BR>";
echo "Filesize: " . number_format($userfile_size) . "<BR>";
echo "Filetype: $userfile_type<BR>";
echo "A List of All Files is at dddd";
}
echo "all done";