{"id":342,"date":"2002-07-23T05:11:30","date_gmt":"2002-07-23T05:11:30","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=342"},"modified":"2002-07-23T05:11:30","modified_gmt":"2002-07-23T05:11:30","slug":"ip-address-whois","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=342","title":{"rendered":"IP address WHOIS"},"content":{"rendered":"<p><? <br \/>\nfunction whois($host){ <br \/>\nif(ereg(&#8220;([0-9]).([0-9]).([0-9]).([0-9])&#8221;,$host)) { <br \/>\n    $server = &#8220;whois.krnic.net&#8221;; <br \/>\n    $port   = 43; <\/p>\n<p>    $fp = fsockopen($server, $port, &#038;$errno, &#038;$errstr, 30); <\/p>\n<p>    fputs($fp, &#8220;$host<br \/>\n&#8220;); <\/p>\n<p>    while(!feof($fp)) { <br \/>\n    $list = fgets($fp, 1024); <br \/>\n    $str=$str.$list; <br \/>\n    } <br \/>\n    fclose($fp); <br \/>\nif(!strpos($str,&#8221;\uc870\ud68c\ud558\uc2e0 \ud574\ub2f9 IP\uc8fc\uc18c\ub294 \uad6d\ub0b4(KRNIC)\uc5d0 \ubc30\uc815\ub41c \uc8fc\uc18c\uac00 \uc544\ub2d9\ub2c8\ub2e4.&#8221;)){ <br \/>\n$ip[0]=strpos($str,&#8221;IP \uc8fc\uc18c&#8221;); <br \/>\n$ip[1]=strpos($str,&#8221;\ub124\ud2b8\uc6cc\ud06c \uc774\ub984&#8221;); <br \/>\n$ip[2]=strpos($str,&#8221;\uc5f0\uacb0 ISP\uba85&#8221;); <br \/>\n$ip[3]=strpos($str,&#8221;ISP \uc5f0\uacb0\ub0a0\uc9dc&#8221;); <br \/>\n$ip[4]=strpos($str,&#8221;\uae30\uad00\uba85&#8221;); <br \/>\n$ip[5]=strpos($str,&#8221;\uc2dc\ub3c4\uba85&#8221;); <br \/>\n$ipaddress=substr($str,$ip[0]+21,$ip[1]-$ip[0]-22); <br \/>\n$netname=substr($str,$ip[1]+21,$ip[2]-$ip[1]-22); <br \/>\n$ispname=substr($str,$ip[2]+21,$ip[3]-$ip[2]-22); <br \/>\n$office_name=substr($str,$ip[4]+21,$ip[5]-$ip[4]-22); <br \/>\n$whois=array(&#8220;IP&#8221; => $ipaddress, <br \/>\n&#8220;ISP&#8221; => $ispname, <br \/>\n&#8220;OFFICE&#8221; => $office_name, <br \/>\n&#8220;NETNAME&#8221; => $netname <br \/>\n); <br \/>\n} else { <br \/>\necho &#8220;\uac80\uc0c9\ud560 \uc218 \uc5c6\ub294 IP \uc8fc\uc18c \uc785\ub2c8\ub2e4.&#8221;; <br \/>\n} <br \/>\n} else { <br \/>\necho &#8220;\uc8c4\uc1a1\ud569\ub2c8\ub2e4. IP\uc8fc\uc18c\ub9cc \uc774\uc6a9\uac00\ub2a5 \ud569\ub2c8\ub2e4.&#8221;; <br \/>\n} <\/p>\n<p>return $whois; <br \/>\n} <\/p>\n<p>\/* IP WHOIS\ud558\ub294 \ud568\uc218 <br \/>\n\ubc30\uc5f4\ub85c IP,\uae30\uad00\uba85,ISP\uc774\ub984,\ub124\ud2b8\uc6cc\ud06c \uc774\ub984\uc744 \ub9ac\ud134\ud55c\ub2e4. <\/p>\n<p>EX > $whois=whois(&#8220;127.0.0.1&#8221;); <br \/>\n       echo &#8220;[KRNIC WHOIS RESULT] $whois[IP] , $whois[OFFICE] , ($whois[ISP]\/$whois[NETNAME])&#8221;; <\/p>\n<p>\uc704\uc640 \uac19\uc740 \uc0ac\uc6a9\uc774 \uac00\ub2a5\ud568. <br \/>\n*\/ <br \/>\n?><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}