Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.