<?php header (' Content-type:text/html;charset=utf-8 ');
if ($_get[' Sub ']) {$ip = $_get[' IP '];
$msg = ';
Ipsearch ();
function Ipsearch () {global $ip, $msg; if (! $ip) {$msg = ' please fill in at least one ip!
';
Return
$arises = Substr_count ($ip, '. ');
$long = Ip2long ($IP); if ($arises!= 3 | | $long = = FALSE | | $long = = 1) {$msg = ' Invalid IP address, please re-enter!
';
Return
} $content = file_get_contents (' http://www.ip138.com/ips1388.asp?action=2&ip= '. $ip);
$content = Iconv (' gb2312 ', ' utf-8 ', $content);
$pos = Stripos ($content, ' <li> site master data '); if (! $pos) {$msg = ' no query!
';
Return
$endPos = Stripos ($content, ' </li> ', $pos);
$jumpLen = strlen (' <li> site master data: ');
$address = substr ($content, $pos + $jumpLen, $endPos-$pos-$jumpLen);
$msg = $address; Return; }? ><! DOCTYPE html>
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/