note 18241 rejected from function.header by hholzgra
| From: | hholzgra@php.net | Date: | Tue, 12 Mar 2002 14:38:18 +0000 |
| Subject: | note 18241 rejected from function.header by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-27664@lists.php.net to get a copy of this message | ||
The recommended method for redirecting has some extra "/" that you should remove in your
app.
The "/" before dirname is extra.
Also you should check that the dirname of PHP_SELF is not just "/" and only then add it.
$url="http://".$HTTP_SERVER_VARS['HTTP_HOST'];
if (dirname($HTTP_SERVER_VARS['PHP_SELF'])!="/")
$url.=dirname($HTTP_SERVER_VARS['PHP_SELF']);
header("Location: ".$url."/".$relative_url);