graham23s Posted May 15, 2007 Share Posted May 15, 2007 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 More sharing options...
taith Posted May 15, 2007 Share Posted May 15, 2007 if($user_class != "Moderator" && $user_class != "Administrator") { Link to comment https://forums.phpfreaks.com/topic/51527-solved-permissions-to-view-certain-pages/#findComment-253753 Share on other sites More sharing options...
graham23s Posted May 15, 2007 Author Share Posted May 15, 2007 Thanks Taith, i was nearly right lol cheers Graham Link to comment https://forums.phpfreaks.com/topic/51527-solved-permissions-to-view-certain-pages/#findComment-253770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.