Re: Get http response codes
- From: Michael Fesser <netizen@xxxxxx>
- Date: Mon, 30 Oct 2006 17:59:56 +0100
..oO(Bart op de grote markt)
I have a website in php in which I have some kind of portal to external
links that come from a database. When a user clicks on a link,
"link.php" is called, does some stuff (e.g. adds 1 to the visit-count
of that certain page) and then forwards the user with a location-header
to the asked page. Now my question: is it possible to get the
response-code of that asked page? E.g. when code 404 is returned, I
can put that in the database and then it's easy for me to know when a
link is broken.
No, because it's the browser that request the other page, not your
script.
But you could let your script perform such a check from time to time:
Maybe every 10th click on that link (or if the last check was more than
1 month ago) your script itself could send a request to the other site
to check its state. If the check succeeds, store the result in your DB
and send the redirect to the browser.
Micha
.
- Follow-Ups:
- Re: Get http response codes
- From: Bart op de grote markt
- Re: Get http response codes
- References:
- Get http response codes
- From: Bart op de grote markt
- Get http response codes
- Prev by Date: Re: Can no connects to mySQL database
- Next by Date: Re: Help me with a regular expression for PHP
- Previous by thread: Re: Get http response codes
- Next by thread: Re: Get http response codes
- Index(es):
Relevant Pages
|