FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Header and if statement
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Header and if statement [message #180017 is a reply to message #179448] Wed, 26 December 2012 17:29 Go to previous messageGo to previous message
Richard Yates is currently offline  Richard Yates
Messages: 86
Registered: September 2013
Karma:
Member
On Mon, 29 Oct 2012 09:36:53 +0100, Bo Wisén <bowisen(at)telia(dot)com>
wrote:

> Hi,
>
> I want to redirect to one page if $typ=0 and another page if $typ=1. I'm
> trying this code:
>
> if ($typ == 0) {
> header ("Location:page1.php");
> } else {
> header ("Location:page2.php");
> }
>
> But undepending on the value of $typ it redirects to page1.php. Why?
>
> / Bo

Try adding exit; after each header statement and before the closing
curly brace.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Happy New Year
Next Topic: does the php is not popular?i am a phper?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 09 17:00:57 GMT 2024

Total time taken to generate the page: 0.04303 seconds