Permission management system is mainly used to set different permissions for different users, so that users with different permissions can use different functions after logging in.
First look at the database
##There are a total of 5 tables, users, roles and roleswork 3 One table forms a "w"-shaped relationship with the other two tables, which is also a relatively common permission database method. First, the permissions are set, that is, the management sets different permissions for different users. 1. Administrator page RBAC.php 2. Administrator’s processing page RBchuli.phpStrQuery($sql,0);
query($sdel); //添加 foreach($arr as $v){ $sql = "insert into users_roles values(0,'{$uid}','{$v}')"; $db->query($sql); }
StrQuery($sql,0); if(!empty($pwd) && $pwd==$mm) { $_SESSION["uid"] = $uid; header("location:RBmain.php"); } else { echo ""; }
The above is the detailed content of How to implement rights management function in PHP. For more information, please follow other related articles on the PHP Chinese website!