Save user permissions as follows: $ permuser, author, and admin can be $ perm ., XXXX; add a permission string separated by special characters. In this example, the "," program uses the following code to determine whether a user has $ isperm permission: $ ispermuser; if (eregSyntaxHig
Save user permissions as follows:
$ Perm = user, author, admin
If you add a permission, it is available.
$ Perm. =, XXXX;
Add a permission string separated by special characters. In this example, "," is used.
You can use the following code to determine whether a user has the $ isperm permission:
$ Isperm = user;
If (ereg ("$ isperm", "$ perm") {echo"
Is a common user ";
} Else {
Echo"
Not a common user ";}
$ Isperm = author;
If (ereg ("$ isperm", "$ perm") {echo"
Is the moderator ";
} Else {
Echo"
Not the moderator ";}
$ Isperm = admin;
If (ereg ("$ isperm", "$ perm") {echo"
Is administrator ";
} Else {
Echo"
Not an administrator ";}
It must be noted that names of different permissions cannot be included, for example:
Admin and bbsadmin
We recommend that you add a special prefix or suffix to each permission name, for example:
Bbsadmin, chatadmin, webadmin
OK.