Вот это мой старый код, с которым я загружал фотографии но только по одной. Как его изменить, так чтобы загружать сразу несколько фотографий? /multiple/ Код (Text): <?php echo ' ?> </div> <div id="div_za_izbor_na_failove" > <h3><img src="http://www.cyberforum.ru/images/camera-icon.png" />Добави изображения </h3> <table border="0" id="tabli4ka" ><tr><td> <input type="file" id="file_1" name="file_name_1" onchange="validaciq_na_izobrajeniqta()" multiple /> </td></tr></table> </div> <input type="hidden" id="hidden_value" value="1" name="number_of_images" /> <input type="hidden" id="pone_edno_izobr" value="no" name="at_least_one_pic" /> <input type="hidden" id="povtarqshti_se_izobrajeniq" value="no" name="povtarqshti_izobrajeniq" /> <input type="button" onclick="choose_another_file()" id="add_image" /></br> <input type="submit" value="Добави!" name="submitche" id="dobavi_zapis" disabled="disabled"> </form> <?php if(isset($_POST["submitche"])) { // vzimane na stoinostite ot tekstovite poleta $kategoriq = $_POST["kategorii"]; $marka = $_POST["marka"]; $model = $_POST["model"]; $godina_na_proizvodstvo = $_POST["godina_na_proizvodstvo"]; if($godina_na_proizvodstvo=="") { $godina_na_proizvodstvo ="NULL"; } else { $godina_na_proizvodstvo ="'$godina_na_proizvodstvo'"; } $dopulnitelna_informaciq = $_POST["tekstova_zona"]; if(empty($dopulnitelna_informaciq)) { $dopulnitelna_informaciq = "NULL" ; } else { $dopulnitelna_informaciq = "'$dopulnitelna_informaciq'" ; } $v_nalichnost = $_POST["available"]; // konekciq kum bazata danni $db = new MYSQL_DB(); $db->connect(); $db->select_db(); $db->set_names_utf_8(); $db->query="select * from advanced"; $db->run_query() ; $db->number_of_results_found_fn(); $namereni_rezultati = $db->number_of_results_found ; $id ; if($namereni_rezultati == 0) { $id = 1 ; } else { $db->query="SELECT COUNT(*) as total FROM advanced"; $db->run_query(); $db->number_of_results_found_fn() ; $rows = $db->number_of_results_found ; $row = mysql_fetch_array($db->query_result) ; $total_rows = $row[0]; $last_row_index = $total_rows - 1 ; $db->query="select Zapis_ID from advanced limit $last_row_index , 1 "; $db->run_query(); $row = mysql_fetch_array($db->query_result) ; $last_id_value = $row[0] ; $id = $last_id_value + 1 ; // da se testva } //echo "ID na posledniq red $id <br/>" ; // testov red $word = new Word_processing(); $model_trimmed = trim($model); $marka_trimmed = trim($marka); $name = $marka_trimmed."_".$model_trimmed."_id_".$id ; $word->name = $name ; $latin_name = $word->kirilica_kum_latinica(); //echo $latin_name."<br/>"; // testov red $number_of_images = $_POST['number_of_images']; // integer $number_of_real_images = 0 ; $at_least_one_pic = false ; for($i = 1 ; $i <= $number_of_images ; $i++) // proverka dali izobshto ima edno izobrano izobrajenie { $file_name = $_FILES["file_name_$i"]["name"]; if($file_name == "") { continue ; } else { $at_least_one_pic = true ; $number_of_real_images++ ; } } //echo " Nomer na poleta za kachvane na izobrajeniq : $number_of_images <br/>"; // testov red //echo "Nomer na realnite izobrajeniq $number_of_real_images <br/> "; $masiv = array(); // masiv sudurjash imenata na failove i tehnite razshireniq for($i = 1 ; $i <= $number_of_images ; $i++) { if($_FILES["file_name_$i"]["name"] == "") { continue ; } else { $masiv[] = $_FILES["file_name_$i"]["name"]; } } for($i = 0 ; $i < $number_of_real_images ; $i++) // proverka da nqma povtarqshti se izobrajeniq { for($z = 0 ; $z < $number_of_real_images ; $z++) { if($z == $i) { continue ; } else { if($masiv[$i]==$masiv[$z]) { echo "Не можеш да качиш две повтарящи се изображения ! Име на повтарящото се изображение : ".$masiv[$i]; exit ; } } } } if($at_least_one_pic == false) { echo "Не сте избрали изображение . Задължително е да изберете поне едно"; exit ; } else { $original_images_string ="" ; $small_images_string =""; $start = 1 ; $upload_folder_for_big_images="http://www.cyberforum.ru/images/Big_images/"; $upload_folder_for_small_images="http://www.cyberforum.ru/images/Small_images/"; // for cikul kopirash originalnoto izobrajenie i praveiki ot nego malko izobrajenie . Populva i gornite dva stringa i postavq sudurjanieto imm v baza danni kato referenciq // kum realnite izobrajeniq for($i = 1 ; $i <= $number_of_images ; $i++) { $file_name = $_FILES["file_name_$i"]["name"]; if($file_name == "") { continue ; } $extention = substr($file_name, -4) ; $path_plus_filename =$upload_folder_for_big_images.$latin_name."_pic_".$start.$extention ; $try_to_upload = move_uploaded_file($_FILES["file_name_$i"]["tmp_name"] , "../".$path_plus_filename); if($try_to_upload == false) { echo "problem pri uploada na source image !!!!"; exit ; } $original_images_string .= $path_plus_filename ; $original_images_string .="|"; resize_image("../".$path_plus_filename ,'210','180',$upload_folder_for_small_images.$latin_name."_pic_".$start.$extention ); $small_images_string .= $upload_folder_for_small_images.$latin_name."_pic_".$start.$extention ; $small_images_string .="|"; $start++; } } $original_images_string =substr($original_images_string ,0 ,-1 ) ; $small_images_string =substr($small_images_string , 0 , -1 ) ; $data = date("Y-m-d"); $db->query="INSERT INTO `shoemake_album`.`advanced` (`Zapis_ID`, `Kategoriq`, `Marka`, `Model`, `Godina_na_proizvodstvo`, `Dopulnitelna_informaciq`, `V_nalichnost`, `Big_images`, `Small_images`, `Data_na_dobavqne` , `Posledna_Redakciq`) VALUES (NULL, '$kategoriq', '$marka_trimmed', '$model_trimmed', $godina_na_proizvodstvo, $dopulnitelna_informaciq, '$v_nalichnost', '$original_images_string', '$small_images_string', '$data' , '$data' );"; //echo $db->query ; $db->run_query() ; $db->affected_rows(); if($db->number_of_affected_rows==1) { echo "Успешно добавихте запис за $marka_trimmed"; } else { echo "Проблем с добавянето на записа !"; } } ?> </div> </body> </html>