FinalFrontier Posted January 11, 2012 Share Posted January 11, 2012 I have a rule of conditions for access into an area of my site. The problem is, that when the wrong password is given, its still giving access to the area of the site. It is happening because I am using conditions wrong, and ask if someone could help me out by pointing out the correct way to do it. When I say "conditions", I am referring to things such as && and || if ($row['laybypassword'] == $_POST['lay-bypassword'] && $row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C") So, if the correct password is given, and the row status equals A, B, or C, then do foobar. Quote Link to comment https://forums.phpfreaks.com/topic/254764-im-not-sure-if-i-am-using-the-conditions-correctly/ Share on other sites More sharing options...
FinalFrontier Posted January 11, 2012 Author Share Posted January 11, 2012 Ah, I needed this: if ($row['laybypassword'] == $_POST['lay-bypassword'] && ($row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C")) This problem is now solved. Quote Link to comment https://forums.phpfreaks.com/topic/254764-im-not-sure-if-i-am-using-the-conditions-correctly/#findComment-1306326 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.