note 15377 added to function.header
| From: | dptagamolila at k2ia dot com | Date: | Fri, 07 Sep 2001 09:30:30 +0000 |
| Subject: | note 15377 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17762@lists.php.net to get a copy of this message | ||
the header command in php can be used with the location parameter to be able to redirect the page to
another one as long as header information has not been sent previously.
e.g.
header(" location : http://yourlocation/here");
This code will work well with PHP hosted on an IIS server running in an NT platform, but this same
code will not work in a red hat/apache/php platform.
Apache has a weird requirement in sending header information. For the previous code to work well,
the location parameter should be coded precisely as follows:
e.g.
header("Location: http://yourlocation/here");
Note that location has changed to "Location:" and that there is no space in between the
colon symbol and the location keyword. Don't ask me why or how, but that is the observed
behavior in Apache. The documentation says something to the same effect except tha it did not
explain why it does so....
We programmers are a very cryptic group of people... duh.... we really need to spruce up
documentation methods :)
happy RECODING.....
http://www.php.net/manual/en/function.header.php