Jump to content

[SOLVED] Permissions to view certain pages


graham23s

Recommended Posts

Hi Guys,

 

i wrote this script:

 

     // Make sure the member has access to the page...///////////////////////////////////
     $query1 = "SELECT * FROM `membership` WHERE `username`='$member'";
     $result1 = mysql_query($query1) or die (mysql_error());
     $row = mysql_fetch_array($result1) or die (mysql_error());
     
     $user_class = $row['user_class'];
     
     if($user_class != "Moderator" || "Administrator") {
     
        echo "<br />Sorry, You Don't Have Permission To View This Page.<br /><br />";
     
     } else {
     
        // if the have access echo out the table...//////////////////////////////////////
        $query2 = "SELECT * FROM `membership`";
        $result2 = mysql_query($query2) or die (mysql_error());
     
     }

 

i used an ENUM for the user types, if the logged in user is not equal to either moderator or administrator then you can't view the page else you can, i changed the user type to moderator but it still says permission denied, any ideas on what i did wrong

 

cheers guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/51527-solved-permissions-to-view-certain-pages/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.