Re: How can I redirect to another php page
| From: | Tommy Jensehaugen | Date: | Fri, 10 Jan 2003 01:30:03 +0000 |
| Subject: | Re: How can I redirect to another php page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131022@lists.php.net to get a copy of this message | ||
If you choose to use
header("Location: yellow.php");
it might be useful to add an exit; statement after it. I have experienced
that if I use more header(..) function calls in one page, it can skip the
first ones. Don't know why, but with the exit; statement your are sure:
if ($Color == "Yellow") {
header( "Location: yellow.php" );
exit;
else if ($Color == "Green")
header( "Location: green.php" );
exit;
}
tommy
"Teo Petralia" <t.mattiozzi@auckland.ac.nz> wrote in message
news:v04220802ba423dc4c316@[130.216.229.11]...
> Hi All!
> I would like to redirect the user to another php page accordingly to
> his/her chosen options, example:
> if ($Color == "Yellow") {
> go to page ....
> else if ($Color == "Green")
> go to page ....
> }
>
> Does anyone knows how to achieve the goal??
>
> Thanks
>
> Teo