Free printable Sudoku Puzzles | Custom Word Search Puzzles | iptocountry.info | Free web storage

Check domain name availability (?)

Access to remote pages tutorial

We will try to get to main page of a domain name we want to search for availability and we will request for "date" in headers (it is not necessary to request the entire page). Possible situations are:

The script includes a form.
 
DomainAvailability.asp           Try it!
<%
If request.form("domain")<>"" then

 ' Intruduce the url you want to visit
 GotothisURL = "http://www." & request.form("domain")

 ' Create the xml object
 Set GetConnection = CreateObject("Microsoft.XMLHTTP")
 ' Conect to specified URL
 GetConnection.Open "get", GotothisURL, False
on error resume next
 GetConnection.Send 

 ' ResponsePage is the response, then print it out to the page
 ResponsePage = GetConnection.getResponseHeader("Date")

' Write response
if ResponsePage="" then 
Response.write("This domain name may be available")
else
Response.write("This domain name is taken")
end if

Set GetConnection = Nothing

else
%>
<form method=post action=<% =request.servervariables("URL") %>>
<input type=text name=domain size=15 value="domain.com">
<input type=submit value="Find domain name">
</form>
<% end if %>

Create word search puzzles with your own words



Add Country identification to your site

Tutorial home page

2008@ AspTutorial.info. All rights reserved.