Hi guys so i want to make page acces to certain ranks.
So im thinking for something like this
rank1 -> home.php, admins.php
rank2 -> home.php
rank3 -> home.php
rank4 -> home.php
So the ranks are in a database with the page names. So now when someone logs in they will get a certain rank. So now i need to make a function that will check if the rank has access to this page.
$curPageName = substr($_SERVER[“SCRIPT_NAME”],strrpos($_SERVER[“SCRIPT_NAME”],"/")+1);
This will detect the current page that the logged in person is at now. But now how do i check if the $_SESSION[‘rank’]; (rank1) has the access to get in page admins.php, and obviously to make $_SESSION[‘rank’];(rank2) redirect from the page admins.php
Could someone point me in the right direction? Do i select the ranks and page names from database then put it into a array?
Thanks.