note 93870 added to function.header
| From: | fgif2 at yahoo dot fr | Date: | Mon, 05 Oct 2009 00:21:22 +0000 |
| Subject: | note 93870 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161268@lists.php.net to get a copy of this message | ||
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 ;)
----
Server IP: 89.31.146.176
Probable Submitter: 91.139.246.58
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/93870
Del: integrated -- https://master.php.net/note/delete/93870/integrated
Del: useless -- https://master.php.net/note/delete/93870/useless
Del: bad code -- https://master.php.net/note/delete/93870/bad+code
Del: spam -- https://master.php.net/note/delete/93870/spam
Del: non-english -- https://master.php.net/note/delete/93870/non-english
Del: in docs -- https://master.php.net/note/delete/93870/in+docs
Del: other reasons-- https://master.php.net/note/delete/93870
Reject -- https://master.php.net/note/reject/93870
Search -- https://master.php.net/manage/user-notes.php