note 61591 rejected from function.header by tularis
| From: | tularis@php.net | Date: | Tue, 07 Feb 2006 14:11:26 +0000 |
| Subject: | note 61591 rejected from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-103199@lists.php.net to get a copy of this message | ||
Note Submitter: effeesse at gmail dot com
----
I think that the location example ins't valid anymore, at least in my environment (*nix+apache,
php4.10);
It says:
header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'].
"/".dirname($HTTP_SERVER_VARS['PHP_SELF']).
"/".$relative_url);
but in my environment "/".dirname($HTTP_SERVER_VARS['PHP_SELF']) outputs a
double slash (//) in front fo the dirname causing php non to follow the expected redirection.
This is because $HTTP_SERVER_VARS['PHP_SELF']) adds a leading slash to the dirname.
I solved by omitting the '/' between the HTTP_HOST and the PHP_SELF.
In addiction probably is better, if not the same, to use the $_SERVER instead of the
$HTTP_SERVER_VARS.
Hope my 2 cents could be useful for someone.