G
Graham Mattingley
Hello
I have this coden (below), that I found that works really well when to prove
a URL is valid, or any object in a URL. They way it works is that you submit
the URL through a form, txtURL is the varable...
What I want to be able to do is have a database of URLs and loop through
them with this in the middle and check all the URLs I have on my database..
so I did
txtURL=rsIslandinfo("URL").Value --- (my database varable)
the whole page loads in about 2 seconds, and all the URL have tested as
invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
object..
any ideas, I wanted to test my database of links are up to date
Regards
Graham Mattingley
if len(trim(Request("txtURL"))) > 0 then
iStatus = 0
sURL = trim(Request("txtURL"))
'Set obj = CreateObject("Microsoft.XMLHTTP")
Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
on error resume next
obj.open "GET", sURL, False
obj.send
if err.number = 0 then
iStatus = obj.Status
end if
on error goto 0
if iStatus = 200 then
Response.write "<p>The URL is valid, status is " & iStatus & "</p>" & vbCRLF
else
Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
vbCRLF
end if
end if
I have this coden (below), that I found that works really well when to prove
a URL is valid, or any object in a URL. They way it works is that you submit
the URL through a form, txtURL is the varable...
What I want to be able to do is have a database of URLs and loop through
them with this in the middle and check all the URLs I have on my database..
so I did
txtURL=rsIslandinfo("URL").Value --- (my database varable)
the whole page loads in about 2 seconds, and all the URL have tested as
invalid, I suspect the value txtURL is not being applyed to the XMLHTTP
object..
any ideas, I wanted to test my database of links are up to date
Regards
Graham Mattingley
if len(trim(Request("txtURL"))) > 0 then
iStatus = 0
sURL = trim(Request("txtURL"))
'Set obj = CreateObject("Microsoft.XMLHTTP")
Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
on error resume next
obj.open "GET", sURL, False
obj.send
if err.number = 0 then
iStatus = obj.Status
end if
on error goto 0
if iStatus = 200 then
Response.write "<p>The URL is valid, status is " & iStatus & "</p>" & vbCRLF
else
Response.write "<p>The URL is invalid, status is " & iStatus & "</p>" &
vbCRLF
end if
end if