I have this function to deal with the images that I want to put on my forum. The problem is that only the pictures located on my server seem to work fine. The others are accepted no matter if they are small enough or not. What am I dong wrong? Maybe somebody has an enhanced script that solves the problem?
Here's my function:
function checkImage($picture)
{
$fp=fopen($picture, "rb");
if($fp)
{
$size = getimagesize ("$picture");
if ($size[0]<150 && $size[1]<150 && $picture!=null)
{
// picture ok
return true;
}
else
{
// picture too large
return false;
}
}
else
{
// no picture
return false;
}
return true;
}