HI guys,
Having some issues here uploading multiple images. The code below illustrates what I need to do. Allow users to upload up to 5 images at one time.
The problem:
The PHP code below is supposed to grab the images via the $_FILES['photos'], which is the array of images...
All I want to do so far is see if there are images, another page will handle the copying etc to the correct dirs.
I just can't get the count of the number of files, what the value of count($photos_uploaded) should be...
Any ideas?
TIA
Bastien
Cat, the other other white meat
Having some issues here uploading multiple images. The code below illustrates what I need to do. Allow users to upload up to 5 images at one time.
The problem:
The PHP code below is supposed to grab the images via the $_FILES['photos'], which is the array of images...
All I want to do so far is see if there are images, another page will handle the copying etc to the correct dirs.
I just can't get the count of the number of files, what the value of count($photos_uploaded) should be...
Any ideas?
Code:
the php code to look at the number of files
<?
$photos_uploaded = $_FILES['photos'];
echo "<br>photos:".count($photos_uploaded);
if (count($photos_uploaded)>0){ $photos = "1"; }
?>
the relevant portion of the form...
<form name="form1" method="post" action="{$_SERVER['PHP_SELF']}" enctype="multipart/form-data">
...
<td><font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">Main
Picture</font></td>
<td><input name="photos[]" type="file" id="dealers_mainpic" size='32'>
<font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">(max.
150 KB)</font></td>
</tr>
<tr>
<td><font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">Additional
Pic</font></td>
<td><input name="photos[]" type="file" id="dealers_pic2" size='32'> <!--AMEND HERE -->
<font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">(max.
150 KB)</font> </td>
</tr>
<tr>
<td> </td>
<td><input name="photos[]" type="file" id="dealers_pic3" size='32'> <!--AMEND HERE -->
<font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">(max.
150 KB)</font> </td>
</tr>
<tr>
<td> </td>
<td><input name="photos[]" type="file" id="dealers_pic4" size='32'> <!--AMEND HERE -->
<font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">(max.
150 KB)</font> </td>
</tr>
<tr>
<td> </td>
<td><input name="photos[]" type="file" id="dealers_pic5" size='32'> <!--AMEND HERE -->
<font color="#000000" size="-1" face="Arial, Helvetica, sans-serif">(max.
150 KB)</font> </td>
</tr>
</table>
<pre> <input name="Submit_dealers" type="submit" id="Submit_dealers" value="Submit"> <input name="Reset_dealers" type="reset" id="Reset_dealers" value="Reset"> </pre>
</form>
TIA
Bastien
Cat, the other other white meat