Re: Get http response codes



..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
.



Relevant Pages

  • Re: How to measure HTML Page Load Time?
    ... side script such as PHP or ASP. ... the browser has received the HTML file, decoded it, done a few other things ... when the browser has finally decided that the page has been fully downloaded ... But what about the time between when the user "presses enter" to request ...
    (comp.lang.javascript)
  • Re: Is it ok to change $ENV{QUERY_STRING} before "use CGI;" is called..?
    ... the Perl script that I'm modifying is not my own code. ... GetParam() calles ->param in it. ... value of a parameter not only from GET request but also from POST ... Because those characters have been already encoded by browser, ...
    (comp.lang.perl.misc)
  • Re: Find within Portal
    ... Thanks Martin, but I am missing a couple of things. ... enter some text for say a client name, I need the browser to then show ... the found records from database A that contain the name or part of the ... you should do a script ...
    (comp.databases.filemaker)
  • Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?
    ... >> no dude, while database are convenient, files systems are faster, I mean ... >> For lots of files I would store them in directories and sub directories. ... Request is sent to the server via a script. ...
    (php.general)
  • Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?
    ... database information is stored in files. ... Data is processed by the database server. ... Request is sent to the server via a script. ...
    (php.general)