Hi
I've inherited some code which does this i.e. returns a URL, if found in the lookup table.
What I'd like to do, through an include file ? or embedded in is found out whether the URL's page can be found.
I've seen something like the code below, but can't get it to work (having it called from an include file somehow would help me!)
I could incorporate it within my existing code somehow within the if statement i.e.
thanks very much
gareth
I've inherited some code which does this i.e. returns a URL, if found in the lookup table.
Code:
if Request ("selSimple1") <> "" then
strSQL = "SELECT URL, URL_NAME FROM CTS_SIMPLE_SERVICES WHERE SERVICEID = " & Request ("selSimple1")
set oRSURL = ExecQueryRS(strSQL,null)
if not oRSURL.EOF and not oRSURL.BOF then
url = oRSURL("URL")
urlName = oRSURL("URL_NAME")
end if
oRSURL.Close
set oRSURL = Nothing
end if
What I'd like to do, through an include file ? or embedded in is found out whether the URL's page can be found.
I've seen something like the code below, but can't get it to work (having it called from an include file somehow would help me!)
Code:
Dim objXMLHTTP, xml
set xml=createObject("Microsoft.XMLHTTP")
xml.onreadystatechange=getRef("state_Change")
xml.open "GET",url,true
xml.send()
function state_Change()
if xml.readyState=4 then
if xml.status=200 then
response.write "Page found ok"
else
response.write "Problem retrieving XML data:" & xml.statusText
end if
end if
end function
Set xml = Nothing
I could incorporate it within my existing code somehow within the if statement i.e.
Code:
if not oRSURL.EOF and not oRSURL.BOF then
url = "Web page cannot be found"
else
url = oRSURL("URL")
end if
thanks very much
gareth