Jump to content

User login


Recommended Posts

Hello can someone point me into the right direction? I've got this code:

 

if ($userdata["user_level"] <> 1 ){

die();

}

 

The above code works but now I want to give users with level 3 also acces but not the users having level 2.

Anyone has an idea?

 

Regards Richard

 

Link to comment
https://forums.phpfreaks.com/topic/212575-user-login/
Share on other sites

Or you could just go:

 

if($userdata['user_level'] == 2){
   die('Wrong user level.');
}

Or if you end up with a few levels that are restricted.

$restricted = array(2, 4, 5, 7); // levels 2, 4, 5 and 7 can't access the page
if(in_array($userdata['user_level'], $restricted)){
   die('Wrong user level.');
}

Link to comment
https://forums.phpfreaks.com/topic/212575-user-login/#findComment-1107428
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.