Here is my code
if ($_FILES['foto']['size'] > 200000) die ('file too big');
if($_FILES['foto']['type'] !== "image/pjpeg" ||
$_FILES['foto']['type'] !=="image/jpeg" || $_FILES['foto']['type']
!=="image/gif") die ('file not allowed!');
no matter what i upload it always showing “file not allowed”. It works fine if i delete the file checking part.
I wonder where are the mistakes.
Thanks
== update===
var dump
string(10) “image/jpeg”
This is a contradiction (Always False):
Since for the whole statement to be true
$_FILES['foto']['type']Must be equal to “image/pjpeg”, “image/jpeg”, and “image/gif” at the same time.You mean to be using
&&instead of||, so you get: