Jiraiya Posted December 21, 2008 Share Posted December 21, 2008 i want to make it so that people cannot view a page unless there "rank" variable is equal to "Kage" how would i go about doing that? Link to comment https://forums.phpfreaks.com/topic/137871-i-need-a-hint/ Share on other sites More sharing options...
shlumph Posted December 21, 2008 Share Posted December 21, 2008 -Make them login before viewing the page, so you can know what rank they are (think $_SESSION) -Make an SQL query to see what the person's rank is (related to the value of the person's $_SESSION) -If the person is "Kage" - then let them view the page -Else header("Location: http://www.google.com"); Give it a shot, come up with some code, and post it up here if you have anymore problems Link to comment https://forums.phpfreaks.com/topic/137871-i-need-a-hint/#findComment-720563 Share on other sites More sharing options...
ngreenwood6 Posted December 21, 2008 Share Posted December 21, 2008 basically when the user logs in you want to set a session value of their rank: $_SESSION['rank'] = "Kage"; then on the page that the user wants to view you would do something like this: if($_SESSION['rank'] != "Kage") { header("location:not_kage.php"); } that checks to see if they are ranked Kage and if not redirects them to not_kage.php. Link to comment https://forums.phpfreaks.com/topic/137871-i-need-a-hint/#findComment-720564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.