|
Posted by Sjoerd on 10/30/06 16:28
Bart schreef 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. When you send a location header to the client, the client requests
the page it is redirected to. Your PHP page only points to the new
page, but is not involved in the retrieval of it. Therefore, it can not
retrieve the headers or the page itself, and thus not the return code
which is part of the headers.
[Back to original message]
|