如何使用XMLHTTP制作域名查询系统的代码案例

<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
     t = GetBody(Path)
  getHTTPPage=BytesToBstr(t,"GB2312")
End function
   
Function GetBody(url)
     on error resume next
     Set Retrieval = CreateObject("Microsoft.XMLHTTP")
     With Retrieval
     .Open "Get", url, False, "", ""
     .Send
     GetBody = .ResponseBody
     End With
     Set Retrieval = Nothing
End Function
   
Function BytesToBstr(body,Cset)
     dim objstream
     set objstream = Server.CreateObject("adodb.stream")
     objstream.Type = 1
     objstream.Mode =3
     objstream.Open
     objstream.Write body
     objstream.Position = 0
     objstream.Type = 2
     objstream.Charset = Cset
     BytesToBstr = objstream.ReadText
     objstream.Close
     set objstream = nothing
End Function
%>
<%
if request("domain")<>"" then
'url=" 
referer=http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domain")
url="http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domain")&"&ext="&request("root")
wstr=getHTTPPage(url)
'www.knowsky.com
'response.write Instr (wstr,"可以注册") 
  if instr(lcase(wstr),"已被注册的域名")>0 then
   body="域名已经被注册"
  elseif instr(lcase(wstr),"未被注册的域名")>0 then
  body="域名未被注册"
  else
   body="网络延迟,请重新查找"
  end if                                  
end if
%>
   
<table width="40%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
  <tr>
   <td height="26" bgcolor="efefef">域名查询系统:<% if request("domain")>"" then response.Write(request("domain")&"."&request("root")&body) end if%></td>
  </tr>
  <tr>
   <td bgcolor="#FFFFFF"><form name="form1" method="post" action=""><table width="100%" border="0" cellspacing="1" cellpadding="1">
     <tr>
      
       <td height="36"> <div align="center">www.
         <input type="text" name="domain">
         <select name="root" id="select">
          <option value="cn" selected>.cn</option>
          <option value="com">.com</option>
          <option value="net">.net</option>
          <option value="org">.org</option>
          <option value="com.cn">.com.cn</option>
          <option value="net.cn">.net.cn</option>
          <option value="gov.cn">.gov.cn</option>
         </select>
        </div></td>
     
     </tr>
     <tr>
      <td height="35">
<div align="center">
        <input type="submit" name="Submit" value=" 查 询 ">
       </div>
       <div align="center"></div></td>
     </tr>
    </table></form></td>
  </tr>
</table>
   
<p align="center">&nbsp;</p>
<table width="40%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
  <tr>
   <td height="42" bgcolor="#FFFFFF">
<FORM name=search_form action='http://search.sohu.com/web' method=get target=_blank>
     <div align="center">
      <input type="hidden" name="pid" value="hljec">
      <input name="query" type="text" style="font-size:14px;width:150" value="好域名">
      <input type="submit" name="ss" value="查看"onclick=document.search_form.action='http://search.sohu.com/web' style="font-size:14px;width=40;height=20">
      &nbsp;</div>
    </FORM></td>
  </tr>
</table>

代码我已经在本地测试过了。正常通过。

以上就是如何使用XMLHTTP制作域名查询系统的代码案例的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

  • 相关标签:XMLHTTP,制作域名,查询系统
  • 程序员必备接口测试调试工具:点击使用

    Apipost = Postman + Swagger + Mock + Jmeter

    Api设计、调试、文档、自动化测试工具

    网页生成APP,用做网站的技术去做APP:立即创建

    手机网站开发APP、自助封装APP、200+原生模块、2000+映射JS接口按需打包

    • 上一篇:详解xmlhttp组件获取远程文件并筛选出目标数据
    • 下一篇:XmlHttp异步获取网站数据的代码案例分析

    相关文章

    相关视频


    • 使用xmlhttp为网站增加域名查询功能的示例代码...
    • 四种XML解析方式详解
    • 基于PHP对XML的操作详解
    • XML和Tomcat的入门知识的详细介绍
    • 如何使用XMLHTTP制作域名查询系统的代码案例
    • Vue3 事件修饰符
    • vue3 指令
    • vue3 基础语法
    • vue3 组合api和选项api介绍

    视频教程分类

    • php视频教程
    • html视频教程
    • css视频教程
    • JS视频教程
    • jQuery视频教程
    • mysql视频教程
    • Linux视频教程
    • Python视频教程
    • Laravel视频教程
    • Vue视频教程

    专题

    如何使用XMLHTTP制作域名查询系统的代码案例