<?
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '$iplong' AND `max` >= '$iplong'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
if (isset($ip2['cl']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '".ip2long($ip2['cl'])."' AND `max` >= '".ip2long($ip2['cl'])."'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
if (isset($ip2['xff']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '".ip2long($ip2['xff'])."' AND `max` >= '".ip2long($ip2['xff'])."'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
?>