I have an if then statement which is supposed to move an uploaded file to a destination location, in the event that the uploaded file is either a jpeg, or a gif. The script, however, tries to move the file even if the uploaded file was not a jpeg or gif. The code is as follows;
if ($_FILES['file']['type'] == "image/pjpeg" || "image/jpeg" || "image/gif") {
$source = "icons/".$id.(substr($HTTP_POST_FILES['file']['name'],-4));
copy ($_FILES['file']['tmp_name'],"icons/".$id.(substr($HTTP_POST_FILES['file']['name'],-4)));
} else if ($_FILES['file']['type'] == "") {
$source = "icons/default.jpg";
} else {
echo "Unknown icon file format!";
$source = "icons/default.jpg";
}