PHP interesse |
|
Goedemiddag,
Ik heb via een site de basis van een upload-functie gebruikt maar die werkt voor geen meter. Ik krijg geen meldingen of wat dan ook. De code is:
<?
if ($_POST["action"] == "Submit") {
$target_path = "images/site";
$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!";
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="uploadedfile" class="textfield"><br>
<input type="submit" name="Submit" value="Upload" class="textfield">
</form>
<? if ($_POST["action"] == "Submit") { $target_path = "images/site"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } ?> <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="uploadedfile" class="textfield"><br> <input type="submit" name="Submit" value="Upload" class="textfield"> </form>
Is er iemand die de fout ziet?
Alvast bedankt!
|