kalabox Posted March 19, 2007 Report Share Posted March 19, 2007 nu taa ir kods luuk taads: <form enctype="multipart/form-data" action="anketa.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> <?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> unvins man tikai saglabā bildes uploads direktorijā, kā lai es dabonu, ka man tās bildes attēlo uz bildes.php ????? Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 Varētu lūdzu parādīt kāds ir anketa.php? Pats visu dienu meklēju šito te fišku! :) Link to comment Share on other sites More sharing options...
kalabox Posted March 19, 2007 Author Report Share Posted March 19, 2007 (edited) tas kods ari bija no anketa.php :D ------------------------------------- Bet viņš ir jebkādam failam... Edited March 19, 2007 by kalabox Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 O! Paldies, tev liels, man sanāca. :) Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 Man arī sanāca izdarīt tā lai bildes pievienojas piem. bildes.php <?php if ($handle = opendir('bildes/')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { echo "<center><img src=\"bildes/$file\"></center>"; } } closedir($handle); } ?> Vienīgais pa tiem izmēriem nez! :/ Link to comment Share on other sites More sharing options...
kalabox Posted March 19, 2007 Author Report Share Posted March 19, 2007 bet viņš jau tikai vienu bildi attēlo, bet vajadzētu man, lai visas, ka sir ievietotas, un samazinātā formā, un smukā rindiņā... :) Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 Nē, viņš attēlo visas tās bildes, kuras ir iekšā bildes folderī! Vismaz man attēlo visas! :) Link to comment Share on other sites More sharing options...
kalabox Posted March 19, 2007 Author Report Share Posted March 19, 2007 aha, ir gan... :) bet tapat vajag smuki sagrupēt... :) Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 Man vis smuki sanāca! <?php if ($handle = opendir('bildes/')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { echo "<center><a href=bildes/$file><img src=\"bildes/$file\" border=1 width=163 height=201></a></center>"; } } closedir($handle); } ?> P.S. Tos width & height vari izlabot. :) Link to comment Share on other sites More sharing options...
kalabox Posted March 19, 2007 Author Report Share Posted March 19, 2007 (edited) Piemēram rekur atradu smuku kodiņu bilžu palielināšanai.. POPup logu automātiski samazina vai palielina.. viss ir ok, tikai neparāda tajā logā biuldi.. <?php if ($handle = opendir('uploads/')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { echo "<img src=\"uploads/$file\" border=0 width=120 height=160><a href=java script:CaricaFoto('uploads/$file')>Palielināt</a>"; } } closedir($handle); } ?> <script LANGUAGE="JavaScript"> <!-- Begin function CaricaFoto(img){ foto1= new Image(); foto1.src=(img); Controlla(img); } function Controlla(img){ if((foto1.width!=0)&&(foto1.height!=0)){ viewFoto(img); } else{ funzione="Controlla('"+img+"')"; intervallo=setTimeout(funzione,20); } } function viewFoto(img){ largh=foto1.width+20; altez=foto1.height+20; stringa="width="+largh+",height="+altez; finestra=window.open(img,"",stringa); } // End --> </script> ------------------------------------- Noteikti tas java chakaree visu..? ---------------------- while (false !== ($file = readdir($handle))) { tieshi taa vieta "!==" cik zinu no C++ un C# valodas ir jaabuut "!=" nevis "!==" vai ne??? Edited March 19, 2007 by kalabox Link to comment Share on other sites More sharing options...
*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 hvz. Bet man pēc sava veida vis normāli sanāca. + vel lietoju labu skriptu, kuru var dabūt šitajā linkā: http://xstyle.id.lv/up/files/lightbox2.02.zip Link to comment Share on other sites More sharing options...
andrisp Posted March 19, 2007 Report Share Posted March 19, 2007 *jancis38*, ja linko uz ne-saviem skriptiem, tad centies linkot uz officiālo paku (officiālajā lapā), jas tas ir iespējams. kalabox, !== pārbauda vai sakrīt netikai vērtība bet arī tās tips. 1 === "1" atgriezīs false. Link to comment Share on other sites More sharing options...
bubu Posted March 19, 2007 Report Share Posted March 19, 2007 kalabox: lūdzu sāc lietot bbtagus un paste.php.lv.Kā arī nejauc Javu ar Javascriptu. Pilnīgi divas dažādas lietas. Link to comment Share on other sites More sharing options...
kalabox Posted March 20, 2007 Author Report Share Posted March 20, 2007 bet uz C++ ir "!=" Link to comment Share on other sites More sharing options...
andrisp Posted March 20, 2007 Report Share Posted March 20, 2007 Nu un ? Praktiski visās valodās ir tāds operators. Nezinu, bet domāju, ka C++ nav tik pieļāvīgs uz mainīgo tipu nedefinēšanu, tāpēc domāju, ka C++ != strādā apt. tāpat kā PHP !==, bet nu ļoti iespējams, ka meloju, jo no C++ vispār neko nesaprotu :). Link to comment Share on other sites More sharing options...
Recommended Posts