Hello guys,
Hopfully someone can correct my coding. i am trying to check the values of an image to be submitted in a form.
My problem is building the if statement to check the dimenssions and file type.
Here's what i have so far
<?
$fp = @fopen("$imgurl", "r");
$size = getimagesize("$imgurl");
if($fp){
$width = $size[0];
$height = $size[1];
$imgType = $size[2];
if($width>75){
$fail("image size incorrect");
elseif
$height>75;
$fail("image size incorrect");
elseif
$imgType==3;
$fail("incorrect image type");
elseif
$imgType>5;
$fail("incorrect image type");
}
echo "img width = $width img height = $height img type = $imgType" ;
}
}
?>
Now i know that the coding is wrong, i am hoping someone here can fix it for me, pretty sure this code could be tweeked right down.
Cheers
Paul