Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['key']) && $_POST['key'] == "12345") {
- // Where the file is going to be placed
- $target_path = "uploads/";
- // Add the original filename to our target path.
- // Result is "uploads/filename.extension"
- $target_path = $target_path . basename( $_FILES['file']['name']);
- if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
- echo "The file ". basename( $_FILES['file']['name']).
- " has been uploaded";
- } else {
- echo "There was an error uploading the file, please try again!";
- }
- } else {
- echo "Invalid key.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement