谁知道.tv的whois查询服务器?谢谢! http://www.csdn.net/expert/topic/915/915093.xml?temp=.129925 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <? $PORT=43; $MAX_RETRIES=5; $SLEEP_TIME=2; function Getserver($domain) { $Servers=array( "net.cn"=>"whois.cnnic.net.cn", "com.cn"=>"whois.cnnic.net.cn", "cn"=>"whois.geektools.com", "net"=>"whois.nsiregistry.net", "cc.cn"=>"whois.nic.cc", "com"=>"whois.nsiregistry.net", "edu.cn"=>"whois.edu.cn", "edu"=>"rs.internic.net", "gov"=>"whois.nic.gov" ); $domain=preg_replace("/^([^\.]*)\.([^\.]*)\./","",$domain); return $Servers[$domain]; } function connect($Server) { global $RETRY,$PORT,$SLEEP_TIME; if ($Server=="") {return(-1);} $retry=0; while ($retry<=$MAX_RETRIES) { $ptr=fsockopen($Server,$PORT); if ($ptr>0) { return ($ptr); } else { $retry++; sleep($SLEEP_TIME); } } return(-1); } function Lookup($domainname,$server="") { global $result; if(empty($server))$server=Getserver($domainname); if (empty($server)) { $result="没有与该域名匹配的Whois服务器,是否拼错了?"; return $result; } $ptr=connect($server); if ($ptr==-1) { $result="无法连接到Whois服务器$server"; return $result; } else { $result=""; fputs($ptr, preg_replace("/^([^\.]*)\./","",$domainname)."\015\012"); while (!feof($ptr)) $result .= fgets($ptr,128) . "<br>"; fclose($ptr); if(preg_match("|Whois Server:\s(.+)\n|",$result,$matches)&&$matches[1]!=$server) $result=Lookup($domainname,$matches[1]);//added by qiushuiwuhen(2002-8-18) return $result; } } ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <form action=<?=$PHP_SELF?>>请输入欲查询的域名(带后缀):<input name=domainname></form><body> <? echo "查询结果如下:"; echo "<hr>"; if(empty($domainname))$domainname="www.csdn.net"; print Getserver($domainname); print "<hr>"; $result=Lookup($domainname); echo $result; ?> </body> </html> tv用whois.tv,如下<? $PORT=43; $MAX_RETRIES=5; $SLEEP_TIME=2; function Getserver($domain) { $Servers=array( "net.cn"=>"whois.cnnic.net.cn", "com.cn"=>"whois.cnnic.net.cn", "cn"=>"whois.geektools.com", "net"=>"whois.nsiregistry.net", "cc.cn"=>"whois.nic.cc", "com"=>"whois.nsiregistry.net", "edu.cn"=>"whois.edu.cn", "edu"=>"rs.internic.net", "gov"=>"whois.nic.gov", "tv"=>"whois.tv" ); $domain=preg_replace("/^([^\.]*)\.([^\.]*)\./","",$domain); return $Servers[$domain]; /* return "whois.nic.cc"; return "whois.OnlineNIC.com"; return "whois.nsiregistry.net"; return "whois.cnnic.net.cn"; return "rs.internic.net"; return "whois.edu.cn"; //教育网 return "whois.OnlineNic.com"; */ return "whois.nsiregistry.net"; return "whois.networksolutions.com";//csdn return "whois.arin.net"; return "whois.InterNIC.net"; return "whois.verisign-grs.com"; return "whois.geektools.com";} function connect($Server) { global $RETRY,$PORT,$SLEEP_TIME; if ($Server=="") {return(-1);} $retry=0; while ($retry<=$MAX_RETRIES) { $ptr=fsockopen($Server,$PORT); if ($ptr>0) { return ($ptr); } else { $retry++; sleep($SLEEP_TIME); } } return(-1); } function Lookup($domainname,$server="") { global $result; if(empty($server))$server=Getserver($domainname); if (empty($server)) { $result="没有与该域名匹配的Whois服务器,是否拼错了?"; return $result; } $ptr=connect($server); if ($ptr==-1) { $result="无法连接到Whois服务器$server"; return $result; } else { $result=""; fputs($ptr, preg_replace("/^([^\.]*)\./","",$domainname)."\015\012"); while (!feof($ptr)) $result .= fgets($ptr,128) . "<br>"; fclose($ptr); if(preg_match("|Whois Server:\s(.+)\n|",$result,$matches)&&$matches[1]!=$server) $result=Lookup($domainname,$matches[1]);//added by qiushuiwuhen(2002-8-18) return $result; } } ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <form action=<?=$PHP_SELF?>>请输入欲查询的域名(带后缀):<input name=domainname></form><body> <? echo "查询结果如下:"; echo "<hr>"; if(empty($domainname))$domainname="www.matrox.tv"; print Getserver($domainname); print "<hr>"; $result=Lookup($domainname); echo $result; ?> </body> </html> 呵呵,谢了,我只需要这几个字whois.tv php中,用echo调用JS函数,有什么问题? php cookie的问题?请教高手 关于SESSION的问题!!急!!!在线等 mvc结构,为什么显示不出来 php3文件是不是不能在PHP4里调试 在线编辑器里图片格式如 简单问题 显示连接 (立即送分!) 大家来畅谈PHP5 ===========脚本高手请进!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!============= 关于XXX.php?id=,XXX.php中的变量id可用的条件是什么? 请问有没有学习PHP比较不错的网站呢、 这样的输出显示怎么写?
$PORT=43;
$MAX_RETRIES=5;
$SLEEP_TIME=2;
function Getserver($domain)
{
$Servers=array(
"net.cn"=>"whois.cnnic.net.cn",
"com.cn"=>"whois.cnnic.net.cn",
"cn"=>"whois.geektools.com",
"net"=>"whois.nsiregistry.net",
"cc.cn"=>"whois.nic.cc",
"com"=>"whois.nsiregistry.net",
"edu.cn"=>"whois.edu.cn",
"edu"=>"rs.internic.net",
"gov"=>"whois.nic.gov"
);
$domain=preg_replace("/^([^\.]*)\.([^\.]*)\./","",$domain);
return $Servers[$domain];
} function connect($Server)
{
global $RETRY,$PORT,$SLEEP_TIME;
if ($Server=="") {return(-1);}
$retry=0;
while ($retry<=$MAX_RETRIES)
{
$ptr=fsockopen($Server,$PORT);
if ($ptr>0)
{
return ($ptr);
}
else
{
$retry++;
sleep($SLEEP_TIME);
}
}
return(-1);
}
function Lookup($domainname,$server="")
{
global $result;
if(empty($server))$server=Getserver($domainname);
if (empty($server))
{
$result="没有与该域名匹配的Whois服务器,是否拼错了?";
return $result;
}
$ptr=connect($server);
if ($ptr==-1)
{
$result="无法连接到Whois服务器$server";
return $result;
}
else
{
$result="";
fputs($ptr, preg_replace("/^([^\.]*)\./","",$domainname)."\015\012");
while (!feof($ptr)) $result .= fgets($ptr,128) . "<br>";
fclose($ptr);
if(preg_match("|Whois Server:\s(.+)\n|",$result,$matches)&&$matches[1]!=$server)
$result=Lookup($domainname,$matches[1]);//added by qiushuiwuhen(2002-8-18)
return $result;
} } ?> <html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<form action=<?=$PHP_SELF?>>请输入欲查询的域名(带后缀):<input name=domainname></form>
<body>
<?
echo "查询结果如下:";
echo "<hr>";
if(empty($domainname))$domainname="www.csdn.net";
print Getserver($domainname);
print "<hr>";
$result=Lookup($domainname);
echo $result;
?>
</body>
</html>
$PORT=43;
$MAX_RETRIES=5;
$SLEEP_TIME=2;
function Getserver($domain)
{
$Servers=array(
"net.cn"=>"whois.cnnic.net.cn",
"com.cn"=>"whois.cnnic.net.cn",
"cn"=>"whois.geektools.com",
"net"=>"whois.nsiregistry.net",
"cc.cn"=>"whois.nic.cc",
"com"=>"whois.nsiregistry.net",
"edu.cn"=>"whois.edu.cn",
"edu"=>"rs.internic.net",
"gov"=>"whois.nic.gov",
"tv"=>"whois.tv"
);
$domain=preg_replace("/^([^\.]*)\.([^\.]*)\./","",$domain);
return $Servers[$domain];
/*
return "whois.nic.cc";
return "whois.OnlineNIC.com";
return "whois.nsiregistry.net";
return "whois.cnnic.net.cn";
return "rs.internic.net";
return "whois.edu.cn"; //教育网
return "whois.OnlineNic.com";
*/
return "whois.nsiregistry.net";
return "whois.networksolutions.com";//csdn
return "whois.arin.net";
return "whois.InterNIC.net";
return "whois.verisign-grs.com";
return "whois.geektools.com";
} function connect($Server)
{
global $RETRY,$PORT,$SLEEP_TIME;
if ($Server=="") {return(-1);}
$retry=0;
while ($retry<=$MAX_RETRIES)
{
$ptr=fsockopen($Server,$PORT);
if ($ptr>0)
{
return ($ptr);
}
else
{
$retry++;
sleep($SLEEP_TIME);
}
}
return(-1);
}
function Lookup($domainname,$server="")
{
global $result;
if(empty($server))$server=Getserver($domainname);
if (empty($server))
{
$result="没有与该域名匹配的Whois服务器,是否拼错了?";
return $result;
}
$ptr=connect($server);
if ($ptr==-1)
{
$result="无法连接到Whois服务器$server";
return $result;
}
else
{
$result="";
fputs($ptr, preg_replace("/^([^\.]*)\./","",$domainname)."\015\012");
while (!feof($ptr)) $result .= fgets($ptr,128) . "<br>";
fclose($ptr);
if(preg_match("|Whois Server:\s(.+)\n|",$result,$matches)&&$matches[1]!=$server)
$result=Lookup($domainname,$matches[1]);//added by qiushuiwuhen(2002-8-18)
return $result;
} } ?> <html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<form action=<?=$PHP_SELF?>>请输入欲查询的域名(带后缀):<input name=domainname></form>
<body>
<?
echo "查询结果如下:";
echo "<hr>";
if(empty($domainname))$domainname="www.matrox.tv";
print Getserver($domainname);
print "<hr>";
$result=Lookup($domainname);
echo $result;
?>
</body>
</html>