Login to VocabMaster
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
$check_ip = explode(",",getRealIpAddr());
$real_ip = $check_ip[0];
//echo $real_ip;
//2012-06-20 แก้ไขเพื่อทดสอบระบบ
//$real_ip = "192.168.92.1";
//echo $real_ip;
$head_ip = explode(".", $real_ip);
if ($head_ip[0] == 192 and $head_ip[1] == 168 and ($head_ip[2] ==96 or $head_ip[2] ==97 or $head_ip[2] ==98 or $head_ip[2] ==99 or $head_ip[2] ==0 or $head_ip[2] ==1 or $head_ip[2] ==100 or $head_ip[2] ==101 or $head_ip[2] ==102)){
// if(1==1){
?>