mixmaster Posted November 3, 2011 Posted November 3, 2011 Probably a stupid question but , can you use both && and || in the same if() statement ? Quote
mixmaster Posted November 3, 2011 Author Posted November 3, 2011 Yes you can. Thanks i must be doing something wrong then lol Quote
bluegman991 Posted November 3, 2011 Posted November 3, 2011 What does the if statement you are trying to write look like. Quote
mixmaster Posted November 3, 2011 Author 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
bluegman991 Posted November 3, 2011 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
mixmaster Posted November 3, 2011 Author Posted November 3, 2011 ahhh right , Thank you for you help and for teaching me something :) Quote
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.