spynode Posted June 17, 2004 Report Share Posted June 17, 2004 Vecajos topikos jau kautko papētiju, bet risinājumu neatradu. Man šis skripts nestrādā un man liekas, ka forma nepadod failu nosaukumus. Lūdzu palīdz, kas var. Link to comment Share on other sites More sharing options...
Kaklz Posted June 18, 2004 Report Share Posted June 18, 2004 lai tiktu pie informācijas par failiem ir jāizmanto $_FILES superglobālais masīvs. http://lv.php.net/manual/en/features.file-upload.php Link to comment Share on other sites More sharing options...
spynode Posted June 18, 2004 Author Report Share Posted June 18, 2004 (edited) Labi es uztaisiju shaadu primitiiivu skriptu, un taa pat vinjsh nestraadaa. - function piev_bildi() { if (isset($_POST['gid'])) { $gid = $_POST['gid']; move_uploaded_file($_FILES['userfile']['tmp_name'], "../bildes/".$gid."/");} echo '<form enctype="multipart/form-data" action="admin.php?darbs=piev_bildi" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="100000"> Galerija:<input name="gid"><br> Bilde: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form>';} Luudzu kaads paliidziet man saprast, kur es esmu kluudijies. Edited June 18, 2004 by spynode Link to comment Share on other sites More sharing options...
Roze Posted June 18, 2004 Report Share Posted June 18, 2004 Te "../bildes/".$gid."/" galaa vajag noraadiit arii pasha jaunaa faila nosaukumu. Ja gribi saglabaat tieshi taadu kaadu uuseris uploadee tad: "../bildes/".$gid."/".$_FILES['userfile']['name'] Preteeji tev tagad fails tiek movots par direktoriju (nevis uz jo peec php dokumentacijas " If the file is valid, it will be moved to the filename given by destination.") kas nav korekti.. Link to comment Share on other sites More sharing options...
Recommended Posts