0

I have 2 sets of users that need access to a shared page. Each user has a different session assigned. Here is what I have. It allows access to 'client1' but not 'admin'

session_start();

if (!isset($_SESSION["client1"]) || $_SESSION["client1"] !== true) {
header("Location: ../../../login.php");

if (!isset($_SESSION["admin"]) || $_SESSION["admin"] !== true) {
header("Location: ../../../login.php");
exit;
   }
}

Any help would be greatly appreciated. Thank you in advance.

1 Answer 1

0
if (isset($_SESSION["client1"]) && $_SESSION["client1"] == true) || (isset($_SESSION["admin"]) && $_SESSION["admin"] == true) {
//show page

}else {
    header("Location: ../../../login.php");
}{
1
  • Thank you for the quick response. It needed an extra set of () around the whole thing. I got it working. Sep 18, 2013 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.