You should always use the exit after a redirect, the browser is not
required to go to the new location.

If you do not exit your script after you redirect and the browser does
not go to the new location you risk the unintended continued execution
of your script.

Jason

On Thu, 2003-01-09 at 18:30, Tommy Jensehaugen wrote:
> 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" <[EMAIL PROTECTED]> 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
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to