note 36408 deleted from function.header by vincent
| From: | vincent@php.net | Date: | Thu, 09 Oct 2003 10:56:07 +0000 |
| Subject: | note 36408 deleted from function.header by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58106@lists.php.net to get a copy of this message | ||
Note Submitter: fredmathieu8@hotmail.com
----
Unless I missed something, there seems to be 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://www.domain///////directory/" in your
browser's adress bar after a couple repetitions, because dirname() keeps the leading
"/".