https://xn--c79as89aj0e29b77z.xn--3e0b707e/kor/main.jsp

 

KISA 후이즈검색 whois.kisa.or.kr

한국인터넷진흥원 인터넷주소자원 검색(후이즈검색) 서비스 입니다.

xn--c79as89aj0e29b77z.xn--3e0b707e

openApi key 발급

 

function kisa_ipcheck_api(){

$ip = $_SERVER["REMOTE_ADDR"];

$key = "===========KEY=========";

$dataFormat = "json";

$url ="http://whois.kisa.or.kr/openapi/ipascc.jsp?query=".$ip."&key=".$key."&answer=".$dataFormat."";

 

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch,CURLOPT_NOSIGNAL, 1);

//curl_setopt($ch,CURLOPT_POST, 1); //Method를 POST로 지정.. 이 라인이 아예 없으면 GET

 

$data = curl_exec($ch);

$curl_errno = curl_errno($ch);

$curl_error = curl_error($ch);

curl_close($ch);

$decodeJsonData = json_decode($data, true);

return $decodeJsonData['whois']['countryCode'];

}

+ Recent posts