程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> php寫的域名查詢系統whois

php寫的域名查詢系統whois

編輯:關於PHP編程

<?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>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved