Kingy Posted March 14, 2008 Share Posted March 14, 2008 I have a user system using sessions, and i have user levels as well. eg: level 1 = admin and level 0 = member. Upon entering an admin page (eg admin.php) i include a file called check.php <?php if(!isset($_SESSION['email'])) { echo "You must be logged in to view this page<BR />"; echo "Redirecting..."; echo "<meta http-equiv='refresh' content='3;url=../index.php?action=login' />"; exit(); } if($_SESSION['level'] == 0) { echo "You do not have the correct privileges<BR />"; echo "Redirecting..."; echo "<meta http-equiv='refresh' content='3;url=../index.php' />"; exit(); } ?> it works.. or should i say worked. Now when ever i enter an admin page (as an admin) for some reason i will get logged in as a level 0 user and it will say you do not have the correct privileges. I don't know if i get logged in as the other member, but i get refreshed back to the main index page and it will show me all of the users information.. This is also happening for the other admins Link to comment https://forums.phpfreaks.com/topic/96110-really-random-problem/ Share on other sites More sharing options...
conker87 Posted March 14, 2008 Share Posted March 14, 2008 Hmm, can we see your login script? Also, try making the level session identical, ie: $_SESSION['level'] === 0 Link to comment https://forums.phpfreaks.com/topic/96110-really-random-problem/#findComment-492034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.