phanouw Posted March 3, 2008 Report Share Posted March 3, 2008 Sveiki, man ir tāds stulbs jautājums! man ir upload skripts kurš izskatās šitāds >> <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="upload1.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="3000000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> </body> un turpinājums >> <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = 'galerija/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "<b>Fails ir Uzlikts!</b>.\n"; } else { echo "Fails Nav Uzlikts!\n"; } print "</pre>"; ?> man ir jautājums > kā var uztiasīt tā kad upload image tad uzreiz tajā galerijas mapē index.php failā skriptā ievietojas tas image! var teikt ka viņš tad pats uztaisa to skriptu! apmēram tākā draugiem.lv?? Link to comment Share on other sites More sharing options...
andrisp Posted March 3, 2008 Report Share Posted March 3, 2008 Tajā index.php taisi, lai viņš nolasa galerija/ mapes failus un izdrukā sarakstu (ar <img> tagu). Ko tieši nemāki? Kā nolasīt direktoriju, skaties te: http://lv2.php.net/opendir Link to comment Share on other sites More sharing options...
kalabox Posted March 18, 2008 Report Share Posted March 18, 2008 shitas jau te ir bijis, pamekleee :) Link to comment Share on other sites More sharing options...
werd Posted March 19, 2008 Report Share Posted March 19, 2008 Ja izmanto DB, tad bus pavisam viegli. Pie bildes uploada pieliec klat query`ju kas pievieno DB ierakstu ar bildes nosaukumu(+veel kadus parametrus drosibai), tad taja lapa kur gribi paradit bildes >>izvelc ierakstus no DB un ieliec <img> taga. Link to comment Share on other sites More sharing options...
Recommended Posts