mas Ellyx mau tanya lagi, saya coba masukkan script di ats yang saya sertkan kotak peringatan untuk batasi size dan type gambar,koq blum bisa ya...(bru belajar).mohon pencerahan, script saya seperti ini:
<?php
//koneksi ke database
$conn = mysql_connect('localhost', 'root', '');
mysql_select_db('galery');
$nama = $_POST;
$alamat= $_POST;
$tmpname = $_FILES;
$filetype = $_FILES;
$filesize = $_FILES;
$fileName = $_FILES;
$lokasifile = "../../upload/$fileName";
$allow = array('image/jpeg','image/jpg');
//upload file
if(empty($nama) || empty($alamat)){
echo"<script>alert(' >>> data tidak lengkap ! <<< ');document.location='from.html'</script>";
}
elseif($filesize < 0 || $_FILES != 0 || in_array($filetype,$allow)){
echo"<script>alert(' >>> gambar belum dipilih ! <<< ');document.location='form.html'</script>";
}
$data = getimagesize($filetype);
elseif($data[0] <=132 && $data[1] <=122){
echo"<script>alert(' >>> gambar max. 132 x 122 ! <<< ');document.location='form.html'</script>";
}
//simpan deskripsi dan nama image ke database
else{
move_uploaded_file($tmpname,$lokasifile);
$sql = "insert into foto(gambar,nama,alamat) values ('$fileName','$nama','$alamat')";
mysql_query($sql);
echo "<script>alert(' >>> data telah disimpan! <<< ');document.location='galery.php'</script>";
}
exit;
?>