andrisp Posted September 19, 2007 Report Share Posted September 19, 2007 Tu taču vispār ignorē to, ko tev saka. Link to comment Share on other sites More sharing options...
NBS Posted September 19, 2007 Author Report Share Posted September 19, 2007 Tu taču vispār ignorē to, ko tev saka. Neteiktu, ka ignorēju, bet nav pareizi to, ko tu man pateici :( Link to comment Share on other sites More sharing options...
andrisp Posted September 19, 2007 Report Share Posted September 19, 2007 Manuprāt, tu pat neesi izmēģinājis to, ko tev saku. Sakabini kopā to kodu ņemot vērā manus padomus un iemet vēlreiz iekš paste.php.lv. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 19, 2007 Report Share Posted September 19, 2007 (edited) Nekas man nesanāk ;(Šeit būs man smirdīgais kods: un gribi lai citi rakaajas pa mesliem? --- 1.neliec to kveriju ieksh funkcijas funkcijai pieliec lai atgriezj bildes nosaukumu utt (masivaa) un tad: $kautkas[0]= saveFile($file_input_name1); $kautkas[1]= saveFile($file_input_name2); // un kverijs $sql="UPDATE xxx SET bilde1='{$kautkas[0]['nosaukums']}' , bilde2='{$kautkas[1]['nosaukums']}.........'"; edit: funkcija jataisaa taa lai citreiz nebutu vinja jaraksta no jauna.... ja liksi ieksa kveriju tad nakamaajaa reizee atkal dabuusi vinju rakstiit ..... Edited September 19, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
NBS Posted September 19, 2007 Author Report Share Posted September 19, 2007 Labi pameiģināšu. Link to comment Share on other sites More sharing options...
NBS Posted September 19, 2007 Author Report Share Posted September 19, 2007 Pameiģināju sanāca šādi: "There was an error uploading the file, please try again!There was an error uploading the file, please try again!There was an error uploading the file, please try again!There was an error uploading the file, please try again!There was an error uploading the file, please try again!" Files #1: http://paste.php.lv/6077 Files #2 http://paste.php.lv/6079 Ieslēdzot E_ALL: http://paste.php.lv/6080 Link to comment Share on other sites More sharing options...
NBS Posted September 19, 2007 Author Report Share Posted September 19, 2007 Saitaisiju, ka met iekšā visas bildes vēl db jāsataisa, ka met un būs super :) Link to comment Share on other sites More sharing options...
NBS Posted September 19, 2007 Author Report Share Posted September 19, 2007 Varu derēt atkal nav tas gudrākais kodēšanas paņēmiens, kas man ir, bet vismaz strādā vai kāds lūdzu vārētu pateikt uzrakstīt priekšā nezinītim, kā var datubāzē iemest šo murgu ? Mans kods: http://paste.php.lv/6084 Link to comment Share on other sites More sharing options...
pilots Posted September 19, 2007 Report Share Posted September 19, 2007 (edited) Man uz migas(lv) reiz bez bēdu darbojās kods ar šādu pamatdomu: <? if ($_GET['act']=='pievienot_bildes'){ $gal = '1'; if(!isset($_FILES) && isset($HTTP_POST_FILES)) $_FILES = $HTTP_POST_FILES; if (!empty($_FILES)){ foreach ($_FILES['fails']['tmp_name'] as $key => $name) { $temp_variants = '../tmp/' . rand() . basename($_FILES['fails']['tmp_name'][$key]); if ($_FILES['fails']['size'][$key]<=2097152){ if ($result = @move_uploaded_file($_FILES['fails']['tmp_name'][$key], $temp_variants)){ list($w, $h, $tips) = @getimagesize($temp_variants); if ($tips == '2'){ if ($image = @imagecreatefromjpeg($temp_variants)){ // Te iet bildes apstrāde imagedestroy($image); } } unlink($temp_variants); header('location: gal.php?cat=galerijas'); } } } } } } ?> pie vairāku bilžu ielādes varam vēl piemest: ini_set("memory_limit","daudzdaudzmegabaitu"); a forma lūk kā man veidojās: <form method="post" action="gogogo.php?act=pievienot_bildes" enctype="multipart/form-data"> <b>PIEVIENOT BILDES:</b><br /> <br />galerijas id<br /><input type="text" name="galerijas_id"><br /> <br /><br />bildes<br /> <? $sk=1000000; for ($i=0; $i<$sk; $i++){ echo '<input type="file" name="fails[]" /><br />'; } ?> <br /><br /><input type="submit" value="Pievienot 1 000 000 bildes!" > </form> edit. kods ta saprotams bij attēlu ielādei bet es to pamatdomu parādīt vairāk vēlējos. gatavu neviens nepienesīs šeit. Edited September 19, 2007 by pilots Link to comment Share on other sites More sharing options...
NBS Posted September 20, 2007 Author Report Share Posted September 20, 2007 Tnx. Link to comment Share on other sites More sharing options...
Recommended Posts