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 2 of 2
  1. #1
    Banned
    Join Date
    Jan 2012
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts

    I'm not sure if I am using the conditions correctly

    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 ||

    PHP Code:
    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.
    Last edited by Inigoesdr; 01-11-2012 at 04:41 AM.

  • #2
    Banned
    Join Date
    Jan 2012
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Ah, I needed this:

    PHP Code:
    if ($row['laybypassword'] == $_POST['lay-bypassword'] && ($row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C")) 
    This problem is now solved.


  •  

    Posting Permissions

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