admin管理员组文章数量:1278795
My admin panel on my nav bar only shows to accounts with the username 'admin' as the moment, I would like it to search my USERS database and only show the link to userswith a user_level of 1.
My DB connection file is called dbh.inc.php My functions are called functions.php
I know what I need to do, but no idea how to do it. I need it to echo the nav bar link to users that are in the USERS table (in my database 'dbproject01') with a user level of 1. Does a function need to be created or something? I get the feeling its an easy fix but it's relatively new to me and I'm stuck.
Here is my code in the nav bar atm
if ($_SESSION['useruid'] == 'admin'){
echo "<li class='nav-item active'>
<a class='nav-link' href='adminpanel.php'>Admin Panel<span class='sr-only'>(current)</span></a>
</li>";
}
Apologise if you need more information or code to help me solve it, not sure which parts I should be posting.
本文标签: In PHP how do I make my navigation bar show certain links to admins only
版权声明:本文标题:In PHP how do I make my navigation bar show certain links to admins only? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741219715a2360731.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论