html - PHP uploader uploads 1 file only -


i have uploader in page design work ipad , have 8 upload boxes.

when upload pictures in uploader, 1 files saved.

how can save pictures gets uploaded?

  • folder set 777.

the page

php:

<? if ( isset( $_post['submit'] ) ){     foreach ($_files['file']['name'] $_key => $_value){         if($_files['file']['size'][$_key] !==0){             $randomizer = rand(0000000, 9999999);     $f=$randomizer.$_files['file']['name'][$_key];     echo $f;     echo "<br>";     $t=$_files['file']['tmp_name'][$_key];     echo $t;     echo "<br>";      //echo $_files['file']['size'][$_key]."<br />";     $file_mb = round(($_files["file"]["size"][$_key] / 1048576), 2);     echo "size: " . $file_mb . " mb<br />";     echo $_files['file']['type'][$_key]."<br />";     if( file_exists($t) ){ move_uploaded_file($t, 'upload/' . $f); }     //move_uploaded_file($_files['file']['tmp_name'][$_key], "upload"/$_files['file']['name'][$_key]);     echo "ok file";     echo "<br>"; }     } } ?> <form id="main_form" action="" method="post" enctype="multipart/form-data"> <?  for($i = 0; $i < 9; $i++) {     echo "<input type=\"file\" name=\"file[]\" /> <br>";     }     ?>      <input  type="submit" name="submit" value="send"> </form> 

html:

<input type="file" name="image1" /><br /> <br /> <br />  <input type="file" name="image2" /><br /> <br /> <br />  <input type="file" name="image3" /><br /> <br /> <br />  <input type="file" name="image4" /><br /> <br /> <br />  <input type="file" name="image5" /><br /> <br /> <br />  <input type="file" name="image6" /><br /> <br /> <br />  <input type="file" name="image7" /><br /> <br /> <br />  <input type="file" name="image8" /><br /> <br /> <br /> 


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -