Advertisement
Thelz

PHP upload gambar

Jan 15th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. $foto                   = $_FILES['foto'];
  2.  
  3.         if (!empty($foto) AND $foto['error'] == 0) {
  4.             $path = './media/images/';
  5.             $upload = move_uploaded_file($foto['tmp_name'], $path . $foto['name']);
  6.  
  7.             if (!$upload) {
  8.                 flash('error', "Upload file gagal");
  9.                 header('location : index.php');
  10.             }
  11.             $file = $foto['name'];
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement