doulian5857
doulian5857
2016-12-31 19:31

具有不同权限的mySQLi和PHP登录系统

  • php
  • mysql

I'm pretty new to PHP and I need to make a login system and I need to check if the user has certain permission, then show something on the page. Let me give a pseudo-code example:

IF USER HAS PERMISSION "CONTACTS" OR USER HAS PERMISSION "ALL"
  SHOW CONTACTS LINK

I've been using DevDojo's php login script, and I wanted something similar or an adaption of that code with a multi-level system. I've tried many things here on SO but none of them really fit my needs, I need to use something like if $user->hasPermission("contacts"). because as I have many features, levels like 1, 2 and etc. won't fit, and admin or not also won't. I'm pretty newbie, so explanation is welcome! Thanks in advance.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答