very good script, but you lose an important variable,
you need to add on line
代碼:
$is_allow_proxy = "no";
before this section:
代碼:
if ($is_allow_proxy==no)
{
$remote_ip=$_SERVER['REMOTE_ADDR'];
function getip() {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{$realip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
elseif (isset($_SERVER['HTTP_CLIENT_IP'])){
$realip=$_SERVER['HTTP_CLIENT_IP'];
}
else
{
$realip=$_SERVER['REMOTE_ADDR'];
}
return $realip;
}
($remote_ip!==getip()) //如果使用了代理
}
?>
those sections should be added in the top part of index.php
代碼:
<script language=vbscript>
location.href="转向地址"
</script>
<?
exit;
}
else{
setcookie("proxyyz","yes",time()+864000,"/",".domain.com",0);
}
}
?>
this section should be added to the top section of page, between <head> and </head>