try this in your reg.php if your using mobile chat script etc
make a ban.php
or use this for ban ip range or seg make a php file called ipban.php and in reg.php put this on top after header codes
include "./ipban.php";
?>
Code:
$cou = mysql_fetch_array(mysql_query("SELECT `ip`,`soft` FROM `chat_users` order by id desc LIMIT 1"));
if($cou[0]=="".getenv(REMOTE_ADDR)."") { include "./ban.php"; }
make a ban.php
Code:
<? echo '<card title="'.getenv(REMOTE_ADDR).'@ NO ACCESS banned!">'; echo "<p align=\"center\">"; echo"<b>banned by staff !</b><br/>"; echo"<b>Contact Site Owners admin@yoursite.com</b><br/>"; echo "<a href=\"index.php\">BACK</a><br/><b>© your site</b>"; echo "</p></card></wml>"; @mysql_close(); ?>
or use this for ban ip range or seg make a php file called ipban.php and in reg.php put this on top after header codes
include "./ipban.php";
Code:
<?
$getip = $_SERVER["REMOTE_ADDR"];
$banned_ip = array();
// Here you change ips which you want ban
$banned_ip[] = '172.99.*';
$banned_ip[] = '200.145.131.216*';
$banned_ip[] = '193.*';
foreach($banned_ip as $banned)
{
$blacked=str_replace('*', '', $banned);
$len=strlen($blacked);
if ($ip==$blacked || substr($getip, 0, $len)==$blacked)
{
echo 'You are banned!';
exit;
}
}
Comment