服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > php教程 >

PHP写的域名查询系统Whois

时间:2016-02-10 10:55来源: 作者: 点击:
PHP写的域名查询系统Whois ?PHP if ($domain) { if ($domain) { $fp = fsockopen( rs.internic.net, 43, $errno, $errstr, 10); if (!$fp) { echo $errstr ($errno)brn; } else { fputs($fp, $domainrn); while(!feof($fp)) { $buf = fgets($fp,128);
PHP写的域名查询系统Whois
<?PHP 
if ($domain) 
if ($domain) 
 
$fp = fsockopen( "rs.internic.net", 43, &$errno, &$errstr, 10); 
if (!$fp) 
echo "$errstr ($errno)<br>n"; 
else 
fputs($fp, "$domainrn"); 
while(!feof($fp)) 
$buf = fgets($fp,128); 
if (ereg( "Whois Server:", $buf)) 
$server = str_replace( "Whois Server: ", "", $buf); 
$server = trim($server); 
fclose($fp); 
if ($server) 
echo "<B>$domain is registered at $server:</B><BR>"; 
echo "<PRE>"; 
$fp = fsockopen($server, 43, &$errno, &$errstr, 10); 
if(!$fp) 
echo "Could not open connection to $server on port 43.n"; 
echo "$errstr ($errno)<br>n"; 
else 
fputs($fp, "$domainrn"); 
while(!feof($fp)) 
echo fgets($fp,128); 
fclose($fp); 
else { 
echo( "<b>$domain does not appear to be registered.</b><BR>"); 
echo ( "</PRE><BR>"); 
 
?> 
<FORM ACTION=" <?PHP echo($PHP_SELF); ?>" METHOD="post"> 
查找 .com, .org, and .net 主机<br> 
主机名: <INPUT TYPE="text" NAME="domain" SIZE="40" MAXLENGTH="100"> 
<INPUT TYPE=submit VALUE="Find out"><INPUT TYPE=reset VALUE="Reset"> 
</FORM> 
(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容