Location: PHPKode > scripts > Multiple Image Upload > HMIU/imgload.php
<?php
$imgsize = $_POST['imgsize'];
echo '<table align=center cellpadding=10 cellspacing=10 style="font-family: Monaco, Verdana, Sans-serif; font-size: 12px;background-color: #f9f9f9;border:1px solid #D0D0D0;color: #002166;width:50%;"><h2><center> Multiple Image Upload Script</center></h2>';
for($i=1;$i<=$imgsize;$i++)
     {
      $form_img.='<tr><td><label> Image'.$i.':</label><td><input type="file" name="img'.$i.'" id="img"></td></tr>';
     }
  if(sizeof($_FILES)==0) 
 {
      $htm.='<form  method="post" action="imgload.php" enctype="multipart/form-data">
           '.$form_img.'<br/>
           <tr><td align=center colspan=2> <input type="submit" value="UploadImage" ></td></tr>';
      echo $htm;
  }
   echo "</form>";
	foreach($_FILES as $arr => $k)
{

  if($_FILES[$arr]['size']<1000000 && $_FILES[$arr]['error']==0)
         {
            if(($_FILES[$arr]['type']=="image/jpeg")|| ($_FILES[$arr]['type']=="image/gif")||($_FILES[$arr]['type']=="image/png"))
              {
                 $path="upload/".$_FILES[$arr]['name'];
                  copy( $_FILES[$arr]['tmp_name'], $path );
                  echo "<tr><td>Image Name :".$_FILES[$arr]['name']."<BR/>";
                  echo "Image Size :".$_FILES[$arr]['size']."<BR/>";
                  echo "image Type :".$_FILES[$arr]['type']."<BR/></td></tr>";
                  echo "<tr><td><img src=\"$path\" width=\"150\" height=\"150\"></ttd></tr>";
                  echo "<P>";
              }
            else
              {
                echo " Invalid ImageType :".$_FILES[$arr]['name']."<br><br>";
              }   
          }         
        else 
          {
          echo " Invalid image";
          }
 }    
echo '</table><div align=center STYLE="font-size: 12px; color: #dadada;">
<a href="http://www.hscripts.com" style="text-decoration:none; color: #dadada;"><b>&copy;h</b></a>
</div>';

?>











Return current item: Multiple Image Upload