|
|

<?php
////////////////////////////////////////////////////////////////////////////////
//File: whois.php
//Author: TZNKTG
//Purpose: This page is search whois domain information
////////////////////////////////////////////////////////////////////////////////
error_reporting(7);
set_time_limit(300);
header("content-Type: text/html; charset=gb2312");
// Server List File
$config['server_list'] = "servers.lst";
$domain = trim($_POST['domain']);
$domain = strtolower($domain);
if(substr($domain,0,7) == "http://") {
$domain = str_replace("http://","",$domain);
}
if(substr($domain,0,4) == "www.") {
$domain = str_replace("www.","",$domain);
}
function whois_request($server, $query)
{
$data = "";
if(!$fp = @fsockopen($server, 43)) {
Return false;
} else {
fputs($fp, $query . "\r\n");
while (!feof($fp)) {
$data .= fread($fp, 1000);
}
fclose($fp);
}
return nl2br($data);
}
function get_server() {
global $config,$domain;
$serverarray = file($config['server_list']);
$i = 0;
foreach($serverarray as $key=>$val) {
if(substr($val,0,1) != "#") {
$server_p = explode("|",$val);
$server[$i]['tld'] = $server_p[0];
$server[$i]['server'] = $server_p[1];
$server[$i]['avail'] = $server_p[2];
$server[$i]['infoserver'] = $server_p[3];
$server[$i]['backserver'] = $server_p[4];
$server[$i]['info'] = $server_p[5];
}
$i++;
}
$domain_c = explode(".",$domain);
$partnum = count($domain_c);
$last_part_1 = $domain_c[$partnum-1];
$last_part_2 = $domain_c[$partnum-2];
foreach($server as $key=>$val) {
if($val['tld'] == $last_part_2.".".$last_part_1) {
Return $val;
} elseif($val['tld'] == $last_part_1) {
Return $val;
}
}
Return false;
}
function startwhois() {
global $domain;
if(!$server = get_server()) {
die("无法查询此类型的域名!");
}
$result1 = whois_request($server['server'], $domain);
$result2 = whois_request($server['infoserver'], $domain);
if(!$result1 && !$result2) {
echo "无法查询此类型的域名!";
die();
} else {
$result = $result1."<br>".$result2;
echo $result;
}
}
if(isset($_GET['action']) && trim($_GET['action']) == "do")
{
startwhois();
die();
}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>台州Link免费提供各类实用查询服务-WhoIS查询工具</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="./images/common.js"></script>
<SCRIPT type="text/javascript">
<!--
var xmlHttp;
function creatXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function startRequest()
{
var queryString;
var domain = document.getElementById('domain').value;
queryString = "domain=" + domain;
creatXMLHttpRequest();
xmlHttp.open("POST","?action=do","true");
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function handleStateChange()
{
if(xmlHttp.readyState == 1)
{
document.getElementById('result').style.cssText = "";
document.getElementById('result').innerText = "Loading...";
}
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
document.getElementById('result').style.cssText = "";
var allcon = xmlHttp.responseText;
document.getElementById('result').innerHTML = allcon;
}
}
}
//-->
</SCRIPT>
</head>
<body>
<table style="margin-bottom: 10px" cellspacing=0 cellpadding=0 width="100%"
align=center bgcolor=#e5e5e5 border=0>
<tbody>
<tr>
<td style="padding-left: 20px" width="5%"><a
href="http://www.5uie.com/"><img alt="无忧 - 5uie.com"
src="images/top_logo.gif"
align=absmiddle border=0></a> </td>
<td style="padding-top: 2px" nowrap align=left width="50%"><a title=实用查询首页
href="http://www.5uie.com/?f=main">首页</a> | <a title=天气、闹钟等网页调用代码
href="http://www.5uie.com/js.php">调用</a> | <a title=个性设置
href="http://www.5uie.com/?f=set">设置</a> | <a title=无忧贴吧论坛
href="http://5uie.com/">贴吧</a> | <a title=友情链接
href="http://www.5uie.com/links.php">链接</a> | <a title=集成搜索
href="http://www.5uie.com/">搜索</a> </td>
<td style="padding-right: 20px; padding-top: 2px" nowrap align=right
width="45%">
<script
src="images/weather.htm"></script>
</td></tr>
<tr>
<td bgcolor=#b4b4b4 colspan=3 height=1></td></tr>
</tbody>
</table>
<div><a title=全国公交及地铁线路查询 href="http://www.5uie.com/gongjiao.php">公交地铁</a>
<a title=各地天气查询 href="http://www.5uie.com/weather.php">天气</a> <a
title=最快速的英汉互译词典,支持中文成语翻译
href="http://www.5uie.com/translate.php">英汉词典</a> <a title=ip归属地查询
href="http://www.5uie.com/ip.php">ip归属</a> <a title=手机号码所在地区强力查询
href="http://www.5uie.com/mobile.php">手机号码</a> <a title=国际、国内邮编及区号查询
href="http://www.5uie.com/zip.php">邮编区号</a> <a title=中国大陆地区居民身份证所在地查询
href="http://www.5uie.com/identity.php">身份证</a> <a title=国内火车车次查询
href="http://www.5uie.com/train.php">火车车次</a> <a title=简体中文/繁体中文转换工具
href="http://www.5uie.com/gb-big5_ff.php">简繁互换</a> <a title=汉字转拼音
href="http://www.5uie.com/pinyin.php">汉字转拼音</a> <br><br><a title=域名是否注册查询
href="http://www.5uie.com/domain.php">域名注册</a> <a title=域名注册信息查询
href="whois.php">whois</a> <a title="google pagerank"
href="http://www.5uie.com/pr.php">pr</a> <a title=网站alexa全球排名查询
href="http://www.5uie.com/alexa.php">alexa</a> <a title=搜索引擎收录情况及网站外部链接查询
href="http://www.5uie.com/seo.php">seo</a> <a title="页面 关键字/关键词 密度 查询"
href="http://www.5uie.com/spider.php">页面分析</a> <a title=分析你的成分
href="http://www.5uie.com/name.php">姓名成分</a> <a title=免费在线发送邮件
href="http://www.5uie.com/email.php">e-mail</a> <a title=在线制作个性邮箱地址图标
href="http://www.5uie.com/picture.php">图标制作</a> <a
title=查询qq在线状态(在线/隐身/离线) href="http://www.5uie.com/qq.php">qq状态</a> <a
title=如有疑问,请来此提出交流。 style="color: red" href="http://5uie.com/list.php?f=1"
target=_blank>网友问题反馈</a>
</div>
<form>
<div>WhoIS查询工具</div>
<div>域名:
<input name="domain" type="text" size="50" onkeydown="if(event.keyCode==13)event.keyCode=9;">
<input type="button" name="button" value="WhoIs" onclick="startRequest();">
<input type="button" name="button" value="返 回" onclick="window.history.back(-1);">
</div>
<div id="result" style="display:none"></div> <div><center>Copyright © 2005-2006 <b>www.tzlink.com</b> All rights reserved. <font
color=#3366cc>浙ICP备06024514号</center></div>
</form>
</body>
</html> |
|