Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP Headers

Status
Not open for further replies.

ResolutionsNET

IS-IT--Management
Jul 31, 2000
70
GB
Can anyone help?

I need to query the HTTP header to grab the Page Status (e.g. 404, 500 etc).

Does anyone know how to do this?

Ta
 
I'm trying to figure out what exactly you are trying to do and thinking about the way this whole web page serving up process happens. If you have some page that does x and you submit it or click a link on the page it gets sent to the server. So far so good. But then you want to check to see if the server really processed your request by checking the header info for 404 or 500 in the page you expect it to server up as a response to your submit or link click?

Don't you have to have a page to contain your code to be able to do this? And if there's a page then there's no chance of a 404? Can you give a little more info about what you are doing? Most of the stuff we've done here is page with form calls processing page and in processing page we have the handy dandy "On Error Resume Next" which will catch most oddities during the processing of the process page. Obviously if the process page does what we expect we direct it to a certain follow-on page, but it we hit an error condition we catch that and direct it to an error page. Any of this helpping? I'm confused and I think others might also be . .

Thanks . .

XoXoXo
Rachel
 
Hey,

We are trying to build link checker. It takes a URL and checks to see if it's still an active one.

any ideas
 
OK . . so I thought of a couple ways it might work. You could create a VB app that's sole job was to spin through your links (kept in a dB) and mark their status as good or not and then have your .asp page read from the dB only the good links? If all the links are on your own server a way to do it is to use the FSO (file system object *) and check for the date last updated. You'd go from your link page to an intermediate page that would check for the date and if there is no date there is no file else redirect to the file (the link clicked)? I checked MS for some help and came up with a couple KB articles you might get ideas from:


and


The second one should be of special interest because much of the code within while VB can be used in asp's. Good luck! If you get something - post it will ya . . Thanks

XoXoXo
Rachel

*
<%'dim objSFile, objFile
Set objSFile = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFile = objSfile.GetFile(Server.MapPath(&quot;linkname.asp&quot;))
Response.Write &quot;Last Modified: &quot;
Response.Write objFile.DateLastModified
%>
 
Hey,

Thanks for the help so far but the URL will be on different machines. I assumed it would be quite easy to call a URL and then query the returning HTTP header for page status.

I'll kept looking.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top