域名查询代码公布(3) 'vg' => 'www.adamsnames.tc/whois/?seen=y&domain=' ); # where can we get more info? $moreinfo = FALSE; for ( reset($moreinfolist) ; list($tail, $moreinfoname) = each($moreinfolist) ; ) if ( eregi("\\.$tail\$", $address) ) { // 比较域名后缀 $moreinfo = $moreinfoname; // 遇到匹配项就立即结束循环 break; } if ( $moreinfo && $address) { // 跳转到WHOIS主机 header('Location: http://'. $moreinfo . $address); exit(); } else { echo "<form action=$PHP_SELF method=post> 请输入域名:<input name=address> <input type=submit></form>"; } ?> <html> <head> <title>whois tool</title> </head> <body> <p>网络技术主管汉化解释</a>.</p> <hr /> <address>http://www.ctohome.com</address> </body> </html> <?php highlight_file("whois.php"); ?>