You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload_picture.php 936 B

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <html>
  8. <head>
  9. <meta charset="UTF-8">
  10. <title>Upload</title>
  11. </head>
  12. <body>
  13. <?php
  14. if (isset($_FILES["file"]["name"])) {
  15. $name = $_FILES["file"]["name"];
  16. $tmp_name = $_FILES['file']['tmp_name'];
  17. $error = $_FILES['file']['error'];
  18. if (!empty($name)) {
  19. $location = 'pictures/';
  20. if (move_uploaded_file($tmp_name, $location.$name)){
  21. echo 'Uploaded';
  22. }
  23. } else {
  24. echo 'please choose a file';
  25. }
  26. }
  27. ?>
  28. <form action="upload_picture.php" method="POST" enctype="multipart/form-data">
  29. <input type="file" name="file"><br><br>
  30. <input type="submit" value="Submit">
  31. </form>
  32. </body>
  33. </html>

No Description

Contributors (1)