Hi,
I am building a fucntion that ads tshirts to multiple tables...
Each tshirt has 3 different images and I want to upload them all into at the same time and add their name to an image table...
Each image should have the same name but is stored in different folders...
heres the upload script (image part only)
These are the from parts
<input TYPE="FILE" NAME="image">
<input TYPE="FILE" NAME="largeimage">
<input TYPE="FILE" NAME="modimage">
// global variables (should i be adding more here?)
global $image, $largeimage, $modimage, $filename, $userfile, $userfile_name, $userfile_size, $userfile_type, $WINDIR;
// standard image
$image_name = "$Tref.jpg";
if(isset($WINDIR)) $image = str_replace("\\","\", $image);
if(empty($image_name)) $image_name = basename($userfile_name);
if($userfile_size <= 0) die ("$image_name is empty.");
if(!@copy($image, "$image_dir/$image_name"))
die("Can't copy $userfile_name to $image_name.");
if(!isset($WINDIR) && !@unlink($image))
die ("Can't delete the file $userfile_name.");
// large image
$largeimage_name = "$Tref.jpg";
if(isset($WINDIR)) $largeimage = str_replace("\\","\", $largeimage);
if(empty($largeimage_name)) $largeimage_name = basename($userfile_name);
if($userfile_size <= 0) die ("$largeimage_name is empty.");
if(!@copy($largeimage, "$image_100_dir/$largeimage_name"))
die("Can't copy $userfile_name to $largeimage_name.");
if(!isset($WINDIR) && !@unlink($largeimage))
die ("Can't delete the file $userfile_name.");
// modelled image
$modimage_name = "$Tref.jpg";
if(isset($WINDIR)) $modimage = str_replace("\\","\", $modimage);
if(empty($modimage_name)) $modimage_name = basename($userfile_name);
if($userfile_size <= 0) die ("$modimage_name is empty.");
if(!@copy($modimage, "$image_mod_dir/$modimage_name"))
die("Can't copy $userfile_name to $modimage_name.");
if(!isset($WINDIR) && !@unlink($modimage))
die ("Can't delete the file $userfile_name.");
Its just echoing back that the file is empty...
Is it something to do with the fact that each file is sending back the same variables???
Please please help
thanks in advance!