Jump to content

adding users to an existing login script


wezze

Recommended Posts

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

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

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.