I m trying to upload multiple photos using
<input type='file'>
with same name to the input element like,
<?php
$remainGal = $maxGallery-$totalGallery;
if($remainGal>0){
?>
<div class="businessSPGItems">
<form name="addBusinessGallery" method="post" action="businessservices.php#messageGallery" enctype="multipart/form-data">
<input type="hidden" name="businessID" value="<?php echo $businessID;?>" />
<?php
for($i=0; $i<$remainGal; $i++){
?>
<input type="file" name="filePhotos[]" style="margin-top:5px;" tabindex="<?php echo $i+5; ?>" /><br />
<?php
}
?>
<input type="submit" name="btnAddGallery" value="Add" style="margin-top:10px;" tabindex="<?php echo $i+5; ?>" />
</form>
</div>
<?php
}
?>
But the problem is when i m taking the total count of the file element it always shows 5... ie.,
<?php
$photos = $_FILES["filePhotos"];
echo count($photos);
?>
So i could not upload more than 5 photos at a time.... i dont know i m doing the correct method.. help please,, thanks...
var_dump($photos);instead.$remainGalis set to 5. Apparently, there will be 5fileHTML controls in your HTML. I suggest you use some advanced file upload input controls like PLUpload, SWFUpload.count($_FILES["filePhotos"]["name"])should work. If uploading nothing throws a notice, you could wrap it in a conditional:if (empty($_FILES["filePhotos"]["name"]) == FALSE) { count($_FILES["filePhotos"]["name"]); }