how do i upload more than one image at a time

adsegzy's Avatar, Join Date: Aug 2010
Newbie Member
please i have this more that i want to use in uploading 5 images at a time, but i don't know how to upload the files into my upload folder;

PHP Code:
<form action="<?php echo $_SESSION['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="form1" id="form1">
 <table width="300" border="0" align="center" cellpadding="5" cellspacing="0">
 <tr>
 <td align="center"><label>
 <input type="file" name="file" />
 </label></td>
 </tr>
 <tr>
 <td align="center"><label>
 <input type="file" name="file2" />
 </label></td>
 </tr>
 <tr>
 <td align="center"><label>
 <input type="file" name="file3" />
 </label></td>
 </tr>
 <tr>
 <td align="center"><label>
 <input type="file" name="file4" />
 </label></td>
 </tr>
 <tr>
 <td align="center"><p>
 <label>
 <input type="file" name="file5" />
 </label>
 </p>
 </td>
 </tr>
 </table>
 <p align="center">
 <label>
 <input type="submit" name="Submit" value="Upload" />
 </label>
 </p>
 </form>
i tried using this move to folder code;

PHP Code:
$file_name = ($_FILES["file"]["name"]);
 
$random_digit=rand(00000,99999);
 
$new_file_name=$random_digit $imageResized;

 if ((
$_FILES["file"]["name"]!="") && file_exists("../upload/" $new_file_name))
 {
 echo 
"<span class='style3'>Please reupload the Picture.</span>";
 }
 else
 {
 
move_uploaded_file($_FILES["file"]["tmp_name"],
 
"../upload/" $new_file_name);
 
$path2"../upload/" $new_file_name
but someone advised i put it in an array but i don't know how to go about that. please ow can i do this or which other less stress way can i do this.

regards
ManzZup's Avatar, Join Date: May 2009
Skilled contributor
i think you'll need to use seperate threads (try googleing)
johnny.dacu's Avatar, Join Date: Jul 2010
Contributor
I' google it before you... here is a result: http://www.phpeasystep.com/phptu/2.html . I hope it helps