I post an image url to a php script. In this php script I get the image url and check what the extension is and if this extension matches a couple of extensions or not:
$ext1 = pathinfo($_POST['form_pic'], PATHINFO_EXTENSION);
$ext = strtolower($ext1);
if($ext != 'jpg' || $ext != 'jpeg' || $ext != 'png' || $ext != 'gif') {
echo $ext; echo "wrong";
}else{
echo "a correct extension";
}
But even when I a post an url like: http://www.test.com/picture.jpg and he gets the extension, in this case jpg, he still goes through the if statement, saying the extension is not equal to the one mentioned in the if statement.
I don't know what I am doing wrong?