View Full Version : Resolved I'm not sure if I am using the conditions correctly

01-11-2012, 04:23 AM
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.

01-11-2012, 04:26 AM
Ah, I needed this:

if ($row['laybypassword'] == $_POST['lay-bypassword'] && ($row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C"))

This problem is now solved.