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";
Multiple File Upload not working, HELP!
Moderator: General Moderators
-
EverToDesign
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 11, 2003 9:38 am
I'm not sure where you're getting $userfile from? When you upload the files you should get:
$_FILES['userfile'][1];
$_FILES['userfile'][2];
etc..etc..
Do a print_r($_FILES); to confirm this.
So wherever you have $userfile i would use $_FILES['userfile']
Also
$filename = basename($_FILES['userfile'][$counter]['name']);
?
$_FILES['userfile'][1];
$_FILES['userfile'][2];
etc..etc..
Do a print_r($_FILES); to confirm this.
So wherever you have $userfile i would use $_FILES['userfile']
Also
That can't be right. Maybe you want$filename = basename($userfile[$counter]_name);
$filename = basename($_FILES['userfile'][$counter]['name']);
?
