mixmaster Posted November 3, 2011 Share Posted November 3, 2011 Probably a stupid question but , can you use both && and || in the same if() statement ? Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted November 3, 2011 Share Posted November 3, 2011 Yes you can. Quote Link to comment Share on other sites More sharing options...
mixmaster Posted November 3, 2011 Author Share Posted November 3, 2011 Yes you can. Thanks i must be doing something wrong then lol Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted November 3, 2011 Share Posted November 3, 2011 What does the if statement you are trying to write look like. Quote Link to comment Share on other sites More sharing options...
mixmaster Posted November 3, 2011 Author Share Posted November 3, 2011 What does the if statement you are trying to write look like. if($ir['user_level'] > 1 && $IP == $IP1 || $IP2) Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted November 3, 2011 Share Posted November 3, 2011 Well I wish what you were doing was possible. But $IP == $IP1 || $IP2 needs to be $IP == $IP1 || $IP == $IP2 That will fix that part. But it still won't condition right. You will need to place parenthesis around it to tell it what to do first since by default || is higher in authority. Anyway the statement should look like this: if($ir['user_level'] > 1 && ($IP == $IP1 || $IP == $IP2)) Quote Link to comment Share on other sites More sharing options...
mixmaster Posted November 3, 2011 Author Share Posted November 3, 2011 ahhh right , Thank you for you help and for teaching me something :) Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted November 3, 2011 Share Posted November 3, 2011 No problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.