wezze Posted June 21, 2012 Share Posted June 21, 2012 Hi i was wondering how to add userlvls to an existing login script. this is what i alrdy did constant.php efine("ADMIN_NAME", "admin"); define("MOD_NAME", "Mod"); define("MEMBER_NAME", "Member"); define("USER_NAME", "User"); define("GUEST_NAME", "Guest"); define("ADMIN_LEVEL", 9); define("MOD_LEVEL", 7); define("MEMBER_LEVEL", 5); define("USER_LEVEL", 2); define("GUEST_LEVEL", 0); now i was wondering how to use this in this part index.php if($session->logged_in){ echo 'some text'; if($session->isAdmin()){ echo "some text"; } echo "<p> </p>" ."<center>[<a href=\"process.php\">Logout</a>]</center>"; } ?> and if i need to add/change more then this? thx Link to comment https://forums.phpfreaks.com/topic/264569-adding-users-to-an-existing-login-script/ Share on other sites More sharing options...
wezze Posted June 23, 2012 Author Share Posted June 23, 2012 ok ive added this if ($_SESSION[ 'member' ]==2) { echo 'some text'; } elseif ($_SESSION[ 'user' ]==5) { echo 'some text'; } but the problem i have is in my admin center when i change a userslvl it doesnt change i can only change it to 1or9 when i choose 2,5,7 it becomes 1. Any ideas what im doing wrong or forgetting? This is my DB var $connection; //The MySQL database connection var $num_active_users; //Number of active users viewing site var $num_active_guests; //Number of active guests viewing site var $num_members; //Number of signed-up users /* Note: call getNumMembers() to access $num_members! */ do i need to add something here? thx Link to comment https://forums.phpfreaks.com/topic/264569-adding-users-to-an-existing-login-script/#findComment-1356345 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.