Forum Moderators: coopster
for($z=1;$z<=$finalrow;$z++){
$file_dir="images/aucitems/";
$file_url="itemimage$z";
$imageset="itemimage$z";
if(isset($imageset)){
if(substr($imageset_type, 0, 5)=="image"){
echo"Got this far";
copy($imageset,"$file_dir/$imageset_name")or die("Couldnt copy image");}
echo"imageset: $imageset<br>";
echo"fileurl: $file_url<br>";
echo"filedir: $file_dir<br><br>";}
$udcontent="details$z";
$udshow="showbox$z";
$query="UPDATE gdon_aucitems SET details='$GLOBALS[$udcontent]',showbox='$GLOBALS[$udshow]' WHERE id='$z'";
if(!mysql_query($query,$link)){$dberror=mysql_error();echo "NOTE: $dberror";return true;}}}
Quite simply, all i want is for it to upload the file to the directory images/aucitems/ (At a later date the file names of the origonal image will be edited via the script, but for now, this is where im at) Any ideas, suggestion etc let me know, appreciate the help...
NOTE: the incramented variable $z is required as there are multiple image inputs on the form, this area (the for statement, loops through each set of details appending the correct number to the set its currently updating, thought id add that as ive had all sorts of questions from previous help with regards to how im using loops) Also i have a set of echo statements reporting back the values of the vars used for the code related to the image upload, just incase that caused a pause for thought...!
Mr Davidson
I tend to use is_uploaded_file() rather than copy.
See PHP Image Functions [php.net] for more.
Birdman
Thanks tho for your help, i think i need some sleep...