note 36346 deleted from function.header by didou
| From: | didou@php.net | Date: | Tue, 07 Oct 2003 07:36:24 +0000 |
| Subject: | note 36346 deleted from function.header by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57957@lists.php.net to get a copy of this message | ||
Note Submitter: Fred
----
Unless I missed something, there is an error in the code to make an absolute URI from a relative
one, at the top of this page.
<?php
header("Location: http://".$_SERVER['HTTP_HOST']."/"
.dirname($_SERVER['PHP_SELF'])."/".$relative_url);
?>
should read:
<?php
header("Location: http://$_SERVER[HTTP_HOST]"
.dirname($_SERVER[PHP_SELF])."/".$relative_url);
?>
unless you want to end up with things like "http://host///////directory/" in your
browser's adress bar after a couple repetitions, because dirname() keeps the leading
"/".