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权限管理 用户与角色管理
= "select * from roles" = ->query(,0( "{[1]}"?>
StrQuery($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 ""; }
权限主页面 query($sql,0); foreach($arr as $v) { 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!