Re: ban ip addresses

Here is the function I use to ban IP:

function isnotallowediprange($ip){
$ban_range_low = ip2long('');
$ban_range_up = ip2long('');
$iplong = ip2long($ip);
if (($iplong > $ban_range_low) and ($iplong < $ban_range_up)){
return true;
} else {
return false;

If you check, you will see that those numbers are negative (i.e., the highest order bit is set). Better use strings and pattern matching.

Best regards,
Willem Bogaerts

Application smith
Kratz B.V.