Re: Get http response codes
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.
.
Relevant Pages
- Re: Help - Timing Logic
... from the database ... ... now you either need to incorporate a locking procedure ... ... opposed to building the transaction in the code. ... implement as above locking only the records you retrieve / update - need ... (microsoft.public.dotnet.languages.vb) - Re: OT: MySQL versus PostgreSQL and database design
... to retrieve all the events at once. ... can make that a primary key in the database. ... likely to want to retrieve all at once, without any sorting. ... different the event types are -- if they've all got exactly the same ... (rec.crafts.metalworking) - Re: Getting a (non-radio) buttons index number from array
... index in the Comment array of the button that was fired. ... you don't need js if you print out the full DOM ... There needs to be some unique way to identify the row in the database. ... Then it's easy to retrieve the ... (comp.lang.php) - Re: OT: MySQL versus PostgreSQL and database design
... to retrieve all the events at once. ... in a way that you can avoid any real searching in your application, ... can make that a primary key in the database. ... I was thinking of sorting the events into different tables so that each table contains one type of event - specifically a subset of events that I'm likely to want to retrieve all at once, ... (rec.crafts.metalworking) - Re: Help - Timing Logic
... If you DBA screams and yells and jumps up and down - this is a database server, we are not install you little program on it ... ... Retrieve list of messages from the database... ... will create a lot of wasted CHECKING and UPDATING and DATABASE LOCKING to ensure messages are not duplicated between recipients. ... Transaction and Database Locking - look at isolation levels / settings ... (microsoft.public.dotnet.languages.vb) |
|