Thelz

PHP upload gambar

Jan 15th, 2020
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data