H
Harag
Hi all
win 2k pro
sql server 2k
asp - vbscript
I got the below code from somewhere ages ago. I have a list of links
on my site that link to other sites but I want to check if the link is
a valid link automatically and if it fails after x checks (checks
every 7 days) then to mark the link as a possible broken link
the below seems to take ages to process and was wondering if there is
a better way to do the below.
thanks for any help & tips.
Al
Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
on error resume next
xmlhttp.open "get", sURL, False
xmlhttp.send
if err.number = 0 then
iStatus = xmlhttp.Status
else
'error might be "DNS error"
iStatus = 404
end if
on error goto 0
Set xmlhttp = nothing
' if status =200 then it is a VALID url.
if iStatus = 200 then
' valid link
' update db here
else
' invalid link.
' update db
end if
win 2k pro
sql server 2k
asp - vbscript
I got the below code from somewhere ages ago. I have a list of links
on my site that link to other sites but I want to check if the link is
a valid link automatically and if it fails after x checks (checks
every 7 days) then to mark the link as a possible broken link
the below seems to take ages to process and was wondering if there is
a better way to do the below.
thanks for any help & tips.
Al
Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
on error resume next
xmlhttp.open "get", sURL, False
xmlhttp.send
if err.number = 0 then
iStatus = xmlhttp.Status
else
'error might be "DNS error"
iStatus = 404
end if
on error goto 0
Set xmlhttp = nothing
' if status =200 then it is a VALID url.
if iStatus = 200 then
' valid link
' update db here
else
' invalid link.
' update db
end if