Re: Go directly to a page

From: Date: Mon, 16 Oct 2000 00:15:01 +0000
Subject: Re: Go directly to a page
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-20285@lists.php.net to get a copy of this message
Remember an exit; afterwards - some browsers like to continue loading the page even after this header.... --Joe On Sun, Oct 15, 2000 at 04:55:03PM -0700, Mark Peoples wrote: > <?php > header("Location: > http://204.205.173.133/test/test.php"); > ?> > > Note: This must come before *any* output is sent to the browser. > > For example, if, right now, users are going to: > http://204.205.173.133/test/somepage.php , somepage.php should > look > something like: > > --somepage.php-- > <?php > header("Location: > http://204.205.173.133/test/test.php"); > ?> > > This would be invalid: > --somepage.php-- > > <?php > header("Location: > http://204.205.173.133/test/test.php"); > ?> > > It is invalid because there is a blank line that is sent to the browser. > > You could redirect users depending on variable (like if they entered > something from a form: > > --fromform.php-- > <?php > if($userInput == "a") > header("Location: > http://204.205.173.133/test/a.php"); > if($userInput == "b") > header("Location: > http://204.205.173.133/test/b.php"); > if($userInput == "c") > header("Location: > http://204.205.173.133/test/c.php"); > if(($userInput != "a") || ($userInput != "b") || ($userInput != > "c")) > header("Location: > http://204.205.173.133/test/wrong.php"); > ?> > > > marco > > > -----Original Message----- > From: Todd Cary [mailto:todd@aristesoftware.com] > Sent: Sunday, October 15, 2000 4:51 PM > To: php-general@lists.php.net > Subject: [PHP] Go directly to a page > > > In PHP, how can I send the surfer directly to a page? > > I want to send the surfer to > http://204.205.173.133/test/test.php > > Todd > > -- > Todd Cary > Ariste Software > todd@aristesoftware.com > > > > -- > 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 > > > -- > 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 /*****************************\ * Joe Stump * * www.Care2.com * * Office: 650.328.0198 * * Extension: 122 * \*****************************/ http://www.miester.org/Joe/Stump/Joe_Stump_resume.html -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$ N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@ 5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)! ------END GEEK CODE BLOCK------

« previous php.general (#20285) next »