note 93870 deleted from function.header by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 17:29:37 +0000 |
| Subject: | note 93870 deleted from function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176209@lists.php.net to get a copy of this message | ||
Note Submitter: fgif2 at yahoo dot fr
----
If you want PHP to generate your desired HTTP status code and corresponding phrase...
Thanks to the notification from guy.paddock AT gmail DOT com, I have accordingly changed the example
inside my little page, in a way to respect the types of the parameters.
http://gif.phpnet.org/frederic/programs/http_status_codes/
I can repeat here an example:
<?php header('x', TRUE, 100); /* server will ouput: "HTTP/1.1 100 Continue"
*/ ?>
To be strict (actually PHP is rather tolerant) let us say:
- the first parameter has to be any NOT EMPTY string,
- the second parameter has to be a boolean, obviously it has to be TRUE, as it would be a nonsense
to send several different status (anyway the server would not let you to do stupid things),
- the third parameter has to be an integer, between 100 and 599; an integer out of that range - or
in range but of unknown value - will generate a
500 Internal Server Error
response.
I hope that helps ;)