title: Can't Upload more than 6 images from php Multiple Image Upload
body: <p>Below is a code I have tinkered with and changed to suit my website needs.  It grabs the images and then uploads them individually, making a thumbnail image and then recoridng the data into a database.</p>
  
  <p>The trouble I have is when I upload 5/6 at a time it sometimes doesn't upload anything nor specify whats wrong.  I added (error_reporting(~0); ini_set('display_errors', 1);) to check the errors but still nothing shone a light as to what was going on.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>PS:-  php.ini is set to:-</p>
  
  <pre><code>upload_max_filesize = 60M  
  post_max_size = 60M
  max_execution_time = 90
  max_file_uploads = 30
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>$j = 0;     
  $target_path = "../../images/";     
  $newimagenumber=$currentimages;
  $imgname = 0;
  $ImgFileName = 0;
  for ($i = 0; $i &lt; count($_FILES['file']['name']); $i++) {
    $target_path = "../../images/";     
    $imgname = 0;
    $ImgFileName = 0;
    $newimagenumber=$newimagenumber+1;
    $imgname=$_POST['FileName'];
    $validextensions = array("jpeg", "jpg", "png", "JPG");      
    $ext = explode('.', basename($_FILES['file']['name'][$i]));  
    $file_extension = end($ext); 
    $ImgFileName="$imgname-$newimagenumber";
    $ImgFileNameExt="$imgname-$newimagenumber.jpg";
    $target_path = $target_path . $ImgFileName . ".jpg";     
    $j = $j + 1;  
    if (($_FILES["file"]["size"][$i] &lt; 5000000) &amp;&amp; in_array($file_extension, $validextensions)) {
      if (move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) {
        $InsertImgFile = mysql_query("INSERT INTO image_data (image_url,image_name,image_customerid,FileName) VALUES ('$ImgFileNameExt','$ImgFileNameExt','$customer_id','$imgname')") or die(mysql_error()); 
        include('CreateNails.php');
        // If file moved to uploads folder.
        echo $j. ').&lt;span id="noerror"&gt;Image uploaded successfully!.&lt;/span&gt;&lt;br/&gt;';
      } else {     //  If File Was Not Moved.
        echo $j. ').&lt;span id="error"&gt;please try again!.&lt;/span&gt;&lt;br/&gt;';
      }
    } else {     //   If File Size And File Type Was Incorrect.
      echo $j. ').&lt;span id="error"&gt;***Invalid file Size or Type***&lt;/span&gt;&lt;br/&gt;';
    }
  }
  }
  </code></pre>