Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This statement</p> <pre><code>if($usertype_user != $permission_result["level_user"] or $usertype_support != $permission_result["level_support"] or $usertype_admin != $permission_result["level_admin"] or $usertype_accounts != $permission_result["level_accounts"]) </code></pre> <p>is true if at least one of these permissions doesn't match, it is false only if all these permissions match. In your case, at least one of user, support, admin, accounts don't match level_user, level_support, level_admin, level_accounts, so check it: you may have admin match (yes==yes or ''==''), but you might be missing something else.</p> <p>You probably want something like this:</p> <pre><code>if( ($permission_result["level_user"] and $usertype_user!='yes') or ($permission_result["level_support"] and $usertype_support!='yes') or ($permission_result["level_admin"] and $usertype_admin!='yes') or ($permission_result["level_account"] and $usertype_accounts!='yes') ) </code></pre> <p><strong>Notes</strong></p> <p>Have a look at <a href="http://php.net/manual/en/language.types.type-juggling.php" rel="nofollow">type jugling</a> in php: if you have <code>" "</code> instead of <code>""</code> somewhere, it is evaluated as <code>true</code></p> <p>The difference between <code>or</code> and <code>||</code> or <code>and</code> and <code>&amp;&amp;</code> is only in precedence, see <a href="http://php.net/manual/en/language.operators.precedence.php" rel="nofollow">the manual</a>, doesn't matter in this case.</p> <p>I'm not sure if <code>$_SERVER["REQUEST_URI"]</code> has to be url encoded; to be sure, you may use <code>mysql_real_escape_string</code> on it - or better, as the comments complain about mysql_* deprecation, <code>mysqli_real_escape_string</code> - or, if you don't use some exotic charset, just <code>addslashes</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload