Why does not the second if
work?
When doing echo
and comment that if
the result of it is 1 (in the case where I am) and if it is 1 or 2 should not redirect me but if it does, does anyone see the failure?
<?php
session_start();
include ("db_files/db.php");
if (!isset($_SESSION['user'])){ header("Location: index.php"); }
echo $_SESSION['userlevel'];
if ($_SESSION['userlevel'] != 1 || $_SESSION['userlevel'] != 2) { header ("location: mainindex.php");}
?>