URL Checker - (One Stage Further)

G

Graham Mattingley

Hello Groups,

I have been testing a script I found that checks URL as valid...
It uses the XMLHTTP.4.0 object

sURL = "http://www.bbc.co.uk"
Set obj = CreateObject("MSXML2.XMLHTTP.4.0")
on error resume next
obj.open "GET", sURL, False
obj.send

iStatus = obj.Status
on error goto 0

this works fine on most URLS, though I do have some problems with redirected
URLs, what I have managed to do is do a database select statement outside of
the script and check my database of URLs.. This works fine..

My Database of URL are the backend of a search engine I have written, what I
was wondering, is instead of me doing a seperate external check of the URLs
using the database as above, can I do something like.....

When the user clicks on a URL, they have a varable director.asp?url=blar
blar blar, this goes to a page that does a redirect to the URL.

Is it possible for me to use the XMLHTTP object to do the redirect, and this
way would it be possible for me to have the users of my site check the URL
by grabbing the value of the statuscode from the XMLHTTP object before it is
redirected. I would like to be able to have the links constantly checked by
the users rather than me have to manually as above say every month.

something like this, if you see below I would be very keen not to make the
jump to the URL slower, so once the URL had been checked using XMLHTTP then
maybe it would be possible to use the redirect...

CLICK ON LINK
|
CHECK URL EXISTS USING XMLHTTP
|
UPDATE DATABASE WITH LAST CHECKED TIMESTAMP
|
REDIRECT TO THE URL

I am not sure if any of this is possible, butjust simple I would like the
user clicking on the link actually check it for me, and have a column in the
database called last_checked TIMESTAMP

Graham Mattingley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top