Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Two mandatory conditions? It does not work ..
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Two mandatory conditions? It does not work ..
You need to think through your logic.

For THIS_SCRIPT != "member.php" AND $GLOBALS['mybb']->input['action'] != "register"
- member.php?action=register: THIS_SCRIPT is 'member.php' so condition is false
- member.php?action=login: THIS_SCRIPT is 'member.php' so condition is still false

For THIS_SCRIPT != "member.php" OR $GLOBALS['mybb']->input['action'] != "register"
- member.php?action=register: THIS_SCRIPT is 'member.php' so first condition is false; action is 'register' so second condition is false, meaning whole condition is false
- member.php?action=login: THIS_SCRIPT is 'member.php' so first condition is still false, but action is NOT 'register', so second condition is true, making the entire condition true

Note that
!(THIS_SCRIPT == 'member.php' AND $mybb->input['action'] == 'register')
is identical to
THIS_SCRIPT != "member.php" OR $GLOBALS['mybb']->input['action'] != "register"
(De Morgan's law)

My Blog
(This post was last modified: 08-21-2012 10:05 AM by ZiNgA BuRgA.)
08-21-2012 10:05 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Two mandatory conditions? It does not work .. - ZiNgA BuRgA - 08-21-2012 10:05 AM

 Standard Tools
Forum Jump: