note 81274 added to function.header
| From: | vclayton at broadwick dot com | Date: | Wed, 20 Feb 2008 21:16:37 +0000 |
| Subject: | note 81274 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136326@lists.php.net to get a copy of this message | ||
If you want to test scripts from the command line, you should know that calls to header() are
silently ignored in the CLI version of PHP. They don't get displayed, and more importantly,
they don't get returned by headers_list().
So if, for example, you're doing automated testing and want to check if your script is
redirecting to to the right location, you can't just check headers_list() for 'Location:
...'. If you want to be able to test header output from the CLI, you'll have to do
something like wrap all calls to header() in your own function that stores the entries in a global
array for later verification.
----
Server IP: 209.41.74.194
Probable Submitter: 66.192.165.133
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/81274
Del: integrated -- https://master.php.net/note/delete/81274/integrated
Del: useless -- https://master.php.net/note/delete/81274/useless
Del: bad code -- https://master.php.net/note/delete/81274/bad+code
Del: spam -- https://master.php.net/note/delete/81274/spam
Del: non-english -- https://master.php.net/note/delete/81274/non-english
Del: in docs -- https://master.php.net/note/delete/81274/in+docs
Del: other reasons-- https://master.php.net/note/delete/81274
Reject -- https://master.php.net/note/reject/81274
Search -- https://master.php.net/manage/user-notes.php