search
HomeBackend DevelopmentXML/RSS TutorialHow to use XMLHTTP to create a code example of a domain name query system

How to use XMLHTTP to create a domain nameQuerySystem code example

<%
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
&#39;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)
&#39;www.knowsky.com
&#39;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"> </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=&#39;http://search.sohu.com/web&#39; 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=&#39;http://search.sohu.com/web&#39; style="font-size:14px;width=40;height=20">
       </div>
    </FORM></td>
  </tr>
</table>

I have tested the code locally. Passed normally.

The above is the detailed content of How to use XMLHTTP to create a code example of a domain name query system. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
RSS in XML: Unveiling the Core of Content SyndicationRSS in XML: Unveiling the Core of Content SyndicationApr 22, 2025 am 12:08 AM

The implementation of RSS in XML is to organize content through a structured XML format. 1) RSS uses XML as the data exchange format, including elements such as channel information and project list. 2) When generating RSS files, content must be organized according to specifications and published to the server for subscription. 3) RSS files can be subscribed through a reader or plug-in to automatically update the content.

Beyond the Basics: Advanced RSS Document FeaturesBeyond the Basics: Advanced RSS Document FeaturesApr 21, 2025 am 12:03 AM

Advanced features of RSS include content namespaces, extension modules, and conditional subscriptions. 1) Content namespace extends RSS functionality, 2) Extended modules such as DublinCore or iTunes to add metadata, 3) Conditional subscription filters entries based on specific conditions. These functions are implemented by adding XML elements and attributes to improve information acquisition efficiency.

The XML Backbone: How RSS Feeds are StructuredThe XML Backbone: How RSS Feeds are StructuredApr 20, 2025 am 12:02 AM

RSSfeedsuseXMLtostructurecontentupdates.1)XMLprovidesahierarchicalstructurefordata.2)Theelementdefinesthefeed'sidentityandcontainselements.3)elementsrepresentindividualcontentpieces.4)RSSisextensible,allowingcustomelements.5)Bestpracticesincludeusing

RSS & XML: Understanding the Dynamic Duo of Web ContentRSS & XML: Understanding the Dynamic Duo of Web ContentApr 19, 2025 am 12:03 AM

RSS and XML are tools for web content management. RSS is used to publish and subscribe to content, and XML is used to store and transfer data. They work with content publishing, subscriptions, and update push. Examples of usage include RSS publishing blog posts and XML storing book information.

RSS Documents: The Foundation of Web SyndicationRSS Documents: The Foundation of Web SyndicationApr 18, 2025 am 12:04 AM

RSS documents are XML-based structured files used to publish and subscribe to frequently updated content. Its main functions include: 1) automated content updates, 2) content aggregation, and 3) improving browsing efficiency. Through RSSfeed, users can subscribe and get the latest information from different sources in a timely manner.

Decoding RSS: The XML Structure of Content FeedsDecoding RSS: The XML Structure of Content FeedsApr 17, 2025 am 12:09 AM

The XML structure of RSS includes: 1. XML declaration and RSS version, 2. Channel (Channel), 3. Item. These parts form the basis of RSS files, allowing users to obtain and process content information by parsing XML data.

How to Parse and Utilize XML-Based RSS FeedsHow to Parse and Utilize XML-Based RSS FeedsApr 16, 2025 am 12:05 AM

RSSfeedsuseXMLtosyndicatecontent;parsingtheminvolvesloadingXML,navigatingitsstructure,andextractingdata.Applicationsincludebuildingnewsaggregatorsandtrackingpodcastepisodes.

RSS Documents: How They Deliver Your Favorite ContentRSS Documents: How They Deliver Your Favorite ContentApr 15, 2025 am 12:01 AM

RSS documents work by publishing content updates through XML files, and users subscribe and receive notifications through RSS readers. 1. Content publisher creates and updates RSS documents. 2. The RSS reader regularly accesses and parses XML files. 3. Users browse and read updated content. Example of usage: Subscribe to TechCrunch's RSS feed, just copy the link to the RSS reader.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor