首页 > 开发 > PHP > 正文

PHP写的域名查询系统whois

2024-05-04 22:55:03
字体:
来源:转载
供稿:网友
<?php
if ($domain)
{
if ($domain)
{

$fp = fsockopen( "rs.internic.net", 43, &$errno, &$errstr, 10);
if (!$fp)
{
echo "$errstr ($errno)
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)
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 主机

主机名: <input type="text" name="domain" size="40" maxlength="100">
<input type=submit value="find out"><input type=reset value="reset">
</form>注册会员,创建你的web开发资料库,
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表