I found this code from here. This is a basic html form that lets you upload an image to a photo album it creates based on the time and date.I managed to implement it and it works correctly as per instructions.Now I would like to have the ability to upload 10 pictures instead of one at a time using this PHP script. The name of the Facebook album is created based on the time and date it is created. This is irrelevant to me, as I will be creating the name of the Facebook album from an HTML input field, so this is irrelevant.What I would like to do is upload these 10 pictures through my HTML form.My html code is as follows:\[code\]<form action="machine.php" method="post" enctype="multipart/form-data">Photo 01 <input name="userfile[]" type="file" >Photo 02 <input name="userfile[]" type="file" >Photo 03 <input name="userfile[]" type="file" >Photo 04 <input name="userfile[]" type="file" >....Photo 10 <input name="userfile[]" type="file" ></form>\[/code\]The HTML code from the tutorial is:\[code\]<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"> <p>Select the image: <input type="file" name="pic" /></p> <p><input class="post_but" type="submit" value="http://stackoverflow.com/questions/15561115/Create album and Upload" /></p> </form>\[/code\]I figured out that if the input's name is name="pic" in the tutorial, then I should replace 'pic' with the name of my HTML input name i.e. 'userfile[]' throughout the PHP script so basically I did.\[code\]$img = realpath($_FILES["pic"]["tmp_name"]);\[/code\]to \[code\]$img = realpath($_FILES["userfile[]"]["tmp_name"]);\[/code\]and \[code\]if( !in_array($_FILES['pic']['type'], $valid_files ) ){\[/code\]to \[code\]if( !in_array($_FILES['userfile[]']['type'], $valid_files ) ){\[/code\]As you can imagine this didn't work at all.Important I do not want to change my HTML form as there are other scripts associated with it. So the changes have to be in the PHP script.