欢迎光临
我们一直在努力

带多选项的域名查询-ASP教程,ASP基础

建站超值云服务器,限时71元/月

其实和做单一的域名查询别无多样,闲话不说,具体是利用再循环查询域名而已.还有我使用不是万网提供的域名查询接口.因为当查询的域名长度少于2位时,就会显示"有问题的域名:..."提示,它查询域名的速度不理想,慢得很,经常弹出"连接超时"提示,这可能是免费提供域名接口的缘故吧,不知道有没有网友体验过呢?

我是使用www.checkdomain.com提供域名查询接口,查询速度蛮理想的.

先说明

http://www.checkdomain.com/cgi-bin/checkdomain.pl?domain=后面是直接查询域名的名字.例如要查询aa.com,那么url就是http://www.checkdomain.com/cgi-bin/checkdomain.pl?domain=aa.com

具体分三部分完成

1.form的内容

<form name="form1" method="post" onsubmit="javascript:return check()">

<table width="400" height="150" border="0" align="center" cellpadding="0" cellspacing="0">

<tr class="td">

<td colspan="2">域名查询系统:</td>

</tr>

<tr class="td">

<td valign="middle"><div align="center">www.

<input name="dns" type="text" id="dns">

</div></td>

<td><input type="submit" name="submit" value="查询"></td>

</tr>

<tr class="td">

<td colspan="2"><p align="center">

<input name="checkbox" type="checkbox" id="checkbox" value="com" checked>

.com

<input type="checkbox" name="checkbox" value="net">

.net

<input type="checkbox" name="checkbox" value="org">

.org

<input type="checkbox" name="checkbox" value="cn">

.cn </p>

<p align="center">

<input type="checkbox" name="checkbox" value="com.cn">

.com.cn

<input type="checkbox" name="checkbox" value="net.cn">

.net.cn

<input type="checkbox" name="checkbox" value="org.cn">

.org.cn </p></td>

</tr>

</table>

2.获取的复选框的内容,并转为数组,再利循环查询域名

<%

if request.form("submit")="查询" then

types=split(request.form("checkbox"),",") 获取当前选择的类型

dns=trim(request.form("dns"))

for i=0 to ubound(types)

edns=dns & "." & trim(types(i))

url="http://www.checkdomain.com/cgi-bin/checkdomain.pl?domain="& edns

wstr=gethttppage(url)

if instr(lcase(wstr),"registered")>0 then

response.write "<a href=whois.asp?domain="& edns & "target=_blank>" & edns &":已被注册</a><br>"

else

response.write edns &":可用域名<br>"

end if

next

end if

%>

3.whois.asp页面

避免出现乱码



gethttppage=bytestobstr(t,"gb2312")

改为

gethttppage=bytestobstr(t,"utf-8")

再截取输出所需域名注册信息

….

wstr=gethttppage(url)

wstr=left(wstr,instrrev(lcase(wstr),"this domain")-7)

si=instr(lcase(wstr),"for you.")+8

wstr=mid(wstr,si,len(wstr))

response.write wstr

上述难免有些错误,欢迎大家指正!

本人邮箱:cudng@163.com

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 带多选项的域名查询-ASP教程,ASP基础
分享到: 更多 (0)

相关推荐

  • 暂无文章