Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Gal kas galetu sukurti

Parašė CyTaS· 2010 Spa. 9 22:10:18
#1

failo ikelimo forma buciau labai dekingas

Parašė Kižas· 2010 Spa. 9 22:10:57
#2

HTML Code:


<form enctype="multipart/form-data" action="uploader.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 Code:


$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!";
}