hey there... I currently have a multiple upload form that handles my file uploading. It defaults to 8 boxes. But when I go to upload the information say I use only 4 of the boxes and then the other 4 still try to upload. I am using count to get the 4 loop on the array.
here is the code that the forms hit... keep in mind the the array containing the files is fu.
require("upload.php");
$np = count($fu);
for($x=0; $x < $np; $x++) {
$size = getimagesize($_FILES['fu']['tmp_name'][$x]);
require("db.php");
$dbc = mysql_connect($dbcon, $dbusr, $dbpas);
mysql_select_db($dbsel, $dbc);
if(@!$size[2] == 2) { die(); }
if($x == 0) { if(!copySizedUploadMain($_FILES['fu']['tmp_name'][$x], "E:\listingphotos\\$PrID-$x.jpg", 425, 425, "$ca[$x]", $size, $PrID, $ClID, $x))
die("Images Failed To Upload"); }
else {
if (!copySizedUpload($_FILES['fu']['tmp_name'][$x], "E:\listingphotos\\$PrID-$x.jpg", 425, 425, "$ca[$x]", $size, $PrID, $ClID, $x))
die("Images Failed To Upload"); }
mysql_close($dbc);
header("cl_main.php?ClID=$ClID");
}
exit;
}
I also tried this for loop but got no where... help!
for($y=0; $y<=$np; $y++) {
if ($_FILES['fu'][$y] == $null) {
$cp = $y;
}
else {
if ($y == $np) {
$cp = $y;
}
}
}