Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Location
    UK
    Posts
    151
    Thanks
    9
    Thanked 2 Times in 2 Posts

    T_IS_EQUAL Problem

    Hey, ive got a T_IS_EQUAL error and i cant see what the problem is

    error:
    Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' in filename.php on line 42
    Line 42:
    PHP Code:
    if (isset($_POST['username'], $_POST['userType']==1)){ 
    thanks

    tyanque

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Your "if" statement is screwy, that's why. Use && to test for true on both conditions, use || to test for true on just one of the condition.

  • #3
    Regular Coder
    Join Date
    Mar 2007
    Location
    UK
    Posts
    151
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Thank for reply

    && gives:

    Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in filename.php on line 42

    and || gives:

    Parse error: syntax error, unexpected T_BOOLEAN_OR, expecting ',' or ')' in filename.php on line 42

    Did you mean changing the if statement to && or ||?

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Change it from:
    PHP Code:
     if (isset($_POST['username'], $_POST['userType']==1)){ 
    to
    PHP Code:
     if (isset($_POST['username']) && isset($_POST['userType']==1)){ 
    Or use the || (or) instead. Whatever you need.

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Tomws that's still wrong.

    Tyanque I would suggest you do some research into basic PHP syntax. Google is your friend (as is the PHP manual).

  • #6
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by Fumigator View Post
    Tomws that's still wrong.
    Blast... that's what I get for a quick copy/paste.

    How's this?
    PHP Code:
      if (isset($_POST['username']) && isset($_POST['userType'])){ 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •