iEntry 10th Anniversary RSS Newsletter Advertising
Visit Twellow.com
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook
CommentTuesday, July 31, 2001

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

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

Publish A Comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
SEARCH
Popular WPN Business Resources












Subscribe to WebProNews


Send me relevant info