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:<p>if($type!="image/gif" || $type!="image/jpeg"){
$error = "Your image needs to have a gif or jpeg format";
}<p>$type in this case is obtained from $_FILES['file']['type']<p>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.