note 15377 deleted from function.header by jimw

From: Date: Wed, 31 Oct 2001 22:12:42 +0000
Subject: note 15377 deleted from function.header by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19818@lists.php.net to get a copy of this message
[Editor's note: The first header example below should never had worked according to the HTTP specs. Therefore the behaviour observed in the Windows-based server is incorrect, non-standard and buggy. Go to www.w3c.org for more information on the HTTP protocol.] 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.....

« previous php.notes (#19818) next »