PHP coding question
To all PHP hackers out there,
I have a basic PHP question. The application I am working on currently allows a user to upload a jpeg or gif image only. My code for enforcing this rule is as follows:
if($type!="image/gif" || $type!="image/jpeg"){ $error = "Your image needs to have a gif or jpeg format"; }
$type in this case is obtained from $_FILES['file']['type']
However, this does not seem to work. Non-JPEG images get rejected properly. However even JPEG images are rejected. Any ideas on how I can check the type of the image.