Print Page | Close Window

Link Test

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6582
Printed Date: 31 March 2026 at 3:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Link Test
Posted By: ctscott
Subject: Link Test
Date Posted: 20 October 2003 at 5:23am
I detect a fair amount of brain power on these forums so maybe someone can help me.  Let's say I provide a way for members to submit a link to another site. The question: how can i automatically validate that the URL is good and a not a 404?  If good. accept for later approval, if bad, tell the submitter.



Replies:
Posted By: MorningZ
Date Posted: 20 October 2003 at 5:33am
Use XMLHttp to try to load the entered URL... it "knows" if the request is good or bad

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: ctscott
Date Posted: 20 October 2003 at 7:01am
thanks for the tip but i'm really looking for a more portable, browser independent solution.  could be wrong, but i believe xmlhttp is an activex object for IE 5+. 


Posted By: WebWiz-Bruce
Date Posted: 20 October 2003 at 7:07am
The XMLHttp object can be used server side in ASP.

You can use it to grab data from another file and then parse it yourself in ASP.

Or in your case use it to see if the URL is good, if nothing is returned then the page doen't exsist and the object will through up an exception error.

I use it on this site to get meta tags on the search engine submission page at:-

http://www.webwiz.net/web_design/search_engine_submission/submission_service.asp - http://www.webwiz.net/web_design/search_engine_submiss ion/submission_service.asp

It browser indpendent as the XMLHttp object is running on the server.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: ctscott
Date Posted: 20 October 2003 at 7:51am

thanks MorningZ and -boRg-.

never seen the server side reference.  looks like i have a little r & d to do.



Posted By: MorningZ
Date Posted: 20 October 2003 at 12:00pm

Referencing http://www.4guysfromrolla.com/webtech/102401-1.shtml - this article on 4guysfromrolla.com , i http://www.morningz.com/test/checkURL.asp - turned out this simple example for you to build on if you want using XMLHttp

cheers



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: ctscott
Date Posted: 20 October 2003 at 12:58pm

it's ugly, it's rude, it's crude.  the send method on a 404 has given me a headache but i got it and a 200 working. 200's are your friend.

thanks again for your help.

time for my nap.

 



Posted By: ctscott
Date Posted: 20 October 2003 at 12:59pm
Originally posted by MorningZ MorningZ wrote:

Referencing http://www.4guysfromrolla.com/webtech/102401-1.shtml - this article on 4guysfromrolla.com , i http://www.morningz.com/test/checkURL.asp - turned out this simple example for you to build on if you want using XMLHttp

cheers

i should clicked on refresh an hour ago so i wouldn't need a nap. i ended up figuring it out the hard way.   

edit: your example is a little cleaner than mine. thanks mz.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net