hi im using this code to verify that an image is valid
if (!ereg("^http://.*\.(bmp|gif|jpg|jpeg)$",$avatar)) {
message($lang_avatarwrongtype, $lang_plscorrectavatar);
} else {
$avatarsize = @getimagesize($avatar);
if($avatarsize['0'] > $settings['avatarw'] || $avatarsize['1'] > $settings['avatarh']) {
message($lang_avatartoolarge, $lang_plscorrectavatar);
} else {
if($avatarsize['0'] < $settings['avatarwlow'] || $avatarsize['1'] < $settings['avatarhlow']) {
message($lang_avatartoosmall, $lang_plscorrectavatar);
} else {
$db->unbuffered_query("UPDATE ".$prefix."users SET avatar='$avatar' WHERE (username='$membercookie')");
message($lang_successfullyavatar, $lang_forwardmemcp, "cp.php");
}
}
}
i got the response form some members that it gives out an error when opening the image or even sais its to big/small (the image lies between the restricitons so it should work)
anyone got an idea what could be wrong
thx for your help