WebProWorld.com Jayde.com SecurityProNews.com | Breaking eBusiness News Submit An Article Advertise About Us Archives Information Technologies Web Development Enterprise eBusiness Home
SecurityProNews > IT > Application Development > WhoIs Query With XMLHttp Sample

[ it_application_development ]

WhoIs Query With XMLHttp Sample


Robbe D. Morris | Contributing Writer
2001-07-31



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")
%>


View All Articles by Robbe D. Morris


About the Author:
Robbe D. Morris http://www.EggheadCafe.com

More it_application_development Articles
iEntry Featured Services: Jayde Member Services | Forums | Freeware | Advertise with Us