In this example, we will try to access default page from gazatem.com. If the status message is 200, we will display all content of this page.
<html><head><title>How to Grab A HTML Page Within an ASP</title></head>
<body>
<%
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.open "GET", "http://www.gazatem.com/", False
objXmlHttp.send
if objXmlHttp.status = 200 then
' Return header code must be equal to 200
strHTML = objXmlHttp.responseText
response.Write(Server.HTMLEncode(strHTML))
else
' There is an erro
response.Write("Error : " & objXmlHttp.statusText)
end if
Set objXmlHttp = Nothing
%>
</body></html>
Happy Coding !
discuss this topic to forum
