What's wrong w/this (if / or) ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • StinkFinger

    #1

    What's wrong w/this (if / or) ?

    When ppmode is set to "cancel" or "thankyou", the header and exit are still
    processed.
    I'm trying to search on "if" and "or" in google, but it keeps removing "or"
    from my searches.

    Is there something wrong w/this ?

    if (($ppmode != "cancel") or ($ppmode != "thankyou") )
    {
    header("Locatio n: index.php");
    exit();
    }

    Thanks.


  • Jasper Bryant-Greene

    #2
    Re: What's wrong w/this (if / or) ?

    StinkFinger wrote:
    [color=blue]
    > When ppmode is set to "cancel" or "thankyou", the header and exit are still
    > processed.
    > I'm trying to search on "if" and "or" in google, but it keeps removing "or"
    > from my searches.
    >
    > Is there something wrong w/this ?
    >
    > if (($ppmode != "cancel") or ($ppmode != "thankyou") )
    > {
    > header("Locatio n: index.php");
    > exit();
    > }
    >
    > Thanks.
    >
    >[/color]

    You want to replace that OR with an AND. At the moment that condition
    will only be satisfied by $ppmode equalling both "cancel" and
    "thankyou", which is impossible.

    --
    Jasper Bryant-Greene
    Cabbage Promotions

    Comment

    • StinkFinger

      #3
      Re: What's wrong w/this (if / or) ?

      Thank you, it's working fine now =)

      "Jasper Bryant-Greene" <jasp@fatalnetw ork.com> wrote in message
      news:isTYc.1989 7$N77.785083@ne ws.xtra.co.nz.. .[color=blue]
      > StinkFinger wrote:
      >[color=green]
      >> When ppmode is set to "cancel" or "thankyou", the header and exit are
      >> still processed.
      >> I'm trying to search on "if" and "or" in google, but it keeps removing
      >> "or" from my searches.
      >>
      >> Is there something wrong w/this ?
      >>
      >> if (($ppmode != "cancel") or ($ppmode != "thankyou") )
      >> {
      >> header("Locatio n: index.php");
      >> exit();
      >> }
      >>
      >> Thanks.[/color]
      >
      > You want to replace that OR with an AND. At the moment that condition will
      > only be satisfied by $ppmode equalling both "cancel" and "thankyou", which
      > is impossible.
      >
      > --
      > Jasper Bryant-Greene
      > Cabbage Promotions[/color]


      Comment

      • Michael Fesser

        #4
        Re: What's wrong w/this (if / or) ?

        .oO(StinkFinger )
        [color=blue]
        >Thank you, it's working fine now =)[/color]

        Just one more thing: The Location-header requires an absolute address.
        See the manual for details.

        <http://www.php.net/header>

        Micha

        Comment

        Working...