How to use XMLHTTP to create a domain name query system code case

Source: Internet
Author: User
This article describes how to use XMLHTTP to create a domain name query system code case, which has some reference value. let's take a look at it. How to use XMLHTTP to create a domain name query system code case

<% On Error Resume NextServer. scriptTimeOut = 9999999 Function getHTTPPage (Path) t = GetBody (Path) getHTTPPage = BytesToBstr (t, "GB2312") End 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 = NothingEnd 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 = nothingEnd 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, "can be registered") if instr (lcase (wstr), "registered domain name")> 0 then body = "the domain name has been registered" elseif instr (lcase (wstr), "unregistered domain name")> 0 then body = "the domain name is not registered" else body = "network delay. please try again" end if %>
 
 
  
    
  
  
        
      
     
   
        
      
   
Domain name query system: <% if request ("domain")> "" then response. write (request ("domain ")&". "& request (" root ") & body) end if %>
  

 

      

I have tested the code locally. Normal.

The above is a detailed example of how to use XMLHTTP to create a domain name query system code case. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.