NYCPHP Meetup

NYPHP.org

[nycphp-talk] Getting HTTP status code

Dan Cech dcech at phpwerx.net
Tue Nov 9 08:48:13 EST 2004


Scott Mattocks wrote:
> Emmanuel Décarie wrote:
> 
>> Is it possible under IIS 5 with PHP 4.2.2 running as a CGI to get the
>> HTTP status code? 
> 
> Yes.
> http://pear.php.net/manual/en/package.http.http-request.response-eval.php
> 
> If you don't want to use the PEAR class, maybe their source code can 
> help you.


I think what Emmanuel was referring to was the response code of the 
server, as he mentions logs.

The problem is that php will only be invoked on a successful request, so 
  the status would always be 200.

The only other codes you could potentially trap and log would be to use 
custom 404 handlers, etc.

Dan



More information about the talk mailing list