Join the WebProWorld Forum!

WhoIs query with XMLHttp Sample

Here's a quick example of how to use the XMLHttp object to perform a WhoIs query. You can then write your own functiosn to strip out the desired content in the page.

I've added our standard code to prevent ASP page caching for your convenience.

<%

Response.Buffer = True
Response.AddHeader "cache-control", "private"
Response.AddHeader "pragma", "no-cache"
Response.ExpiresAbsolute = #January 1, 1990
00:00:01#
Response.Expires=0

Function WhoIS(sDomain)

Dim oXMLHttp

on error resume next

Set oXMLHttp=Server.CreateObject
("MSXML2.XMLHTTP")

oXMLHttp.open "GET",
"http://www.networksolutions.com/cgi-bin/whois
/whois/?STRING=" & Trim(sDomain), false

oXMLHttp.send

if oXMLHttp.status = 200 Then
WhoIS = oXMLHttp.responseText
else
WhoIs = "0"
end if

Set oXMLHttp = Nothing

End Function

response.write WhoIs("eggheadcafe.com")
%>

Robbe D. Morris
http://www.EggheadCafe.com

Digg This! StumbleUpon This!
AddThis Social Bookmark Widget

News Tags: WHOIS, query
About the author:
Robbe D. Morris http://www.EggheadCafe.com

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
5 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.