im allowing users to upload files from a form to a mysql table. it uploads the files but i want to allow only .jpg files to be uploaded. right now im doing this:
$ext = strrchr(basename($pic_name), '.');
if(($ext != ".jpg") || ($ext != ".jpeg")) die("Your picture file must be in JPG or JPEG format!");
anybody know why this wouldnt work?
i also tried fiddling around with:
if(($pic_type != "image/jpg") || ($pic_type != "image/jpeg")) die ("Your picture must be in JPG or JPEG format!");
i get the die messages even with jpg pictures. does anybody have any input?! anything else i should try? thanks for any help!
-phil