Re: Re: How can I redirect to another php page

From: Date: Fri, 10 Jan 2003 02:25:07 +0000
Subject: Re: Re: How can I redirect to another php page
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-131025@lists.php.net to get a copy of this message
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" <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 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#131025) next »