중국, 러시아 아이피 전부 막기
페이지 정보
본문
function get_block_ip($ip)
{
   global $config, $g5;
   //$ip = $_SERVER['REMOTE_ADDR'];
   $query = @unserialize(file_get_contents('http://ip-api.com/php/'.$ip));
$arr = array("CN","RU");
   for ($i=0; $i<count($arr); $i++)
   {
       if($arr[$i] == $query['countryCode']) {
           $sql = " select count(*) as cnt from {$g5['config_table']} where (INSTR(cf_intercept_ip, '$ip')) ";
           $chk = sql_fetch($sql);
           if (!$chk['cnt']) {
               $cf_intercept_ip = $config['cf_intercept_ip']."\n".$ip;
               sql_query(" update {$g5['config_table']} set cf_intercept_ip = '$cf_intercept_ip' ");
           } else {
               goto_url(G5_URL."/404.html");
           }
       }
   }
}
댓글목록
등록된 댓글이 없습니다.





 
