Jump to content

Really random problem


Kingy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.