Re: PHP Redirect / header("location: ")
| From: | Bas Jobsen | Date: | Fri, 09 Nov 2001 08:42:20 +0000 |
| Subject: | Re: PHP Redirect / header("location: ") | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74008@lists.php.net to get a copy of this message | ||
> Am I doing something wrong? Thank you.
You may print nothing before the redirect header!
<?
echo "hello";
header("Location: go");
exit;
#wrong!
?>
<?
<?
header("Location: go");
exit;
echo "hello";
#oke, but "hello" isn't print
?>
?>
----- Original Message -----
From: "phantom" <phantom@phantomcougar.com>
To: <php-general@lists.php.net>
Sent: Friday, November 09, 2001 10:01 AM
Subject: [PHP] PHP Redirect / header("location: ")
> I am trying to set up a redirect scirpt that in ASP was
> response.redirect(escape("newpage.asp")).
>
> I tried in PHP >> header("location: newpage.php")
>
> but all i got was an error message saying that my header content had
> already been sent. This PHP script was above the html script.
>
> Am I doing something wrong? Thank you.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>