Re: weird header() (bug may be)
| From: | Eric Bolikowski | Date: | Thu, 12 Feb 2004 06:40:41 +0000 |
| Subject: | Re: weird header() (bug may be) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177478@lists.php.net to get a copy of this message | ||
Headers have to be pretty accurate, or it will cause trouble.
And your redirect header is not quite correct.
It should be this:
header("Location: another_page.php");
and NOT header("Location:another_page.php");
What you need here is a space between "Location:" and the URL.
"Adwinwijaya" <adwinwijaya@yahoo.com.au> wrote in message
news:1889621761.20040212172029@yahoo.com.au...
> Hello php-generaler's ,
>
> I have a script like this :
>
> if($foo == 'something'){
> header('Location:to_another_page.php') ;
> }else
> {
> do another thing in here
> }
>
> header('Location:to_previous_page.php');
>
>
> I got a problem ... when $foo == 'something' .. it wont redirect me
> to to_another_page.php .... but if I put die(); after calling
> header(); .. it will work ...
>
> is this the bug ?
>
> I use php 4.3.4 ... and Apache 2.x
>
> thanks
>
>
> --
> Best regards,
> adwinwijaya
> mailto:adwinwijaya@yahoo.com.au