Hi I have following files:
login.php, index.php, header.php, footer.php, restrictaccess.php
restrictaccess.php has following code:
<?php
session_start();
if (!(isset($_SESSION['user']) && $_SESSION['user'] != ''))
if (!(isset($_SESSION['access']) && $_SESSION['access'] != ''))
{
header ("Location: login.php");
exit();
}
if($_SESSION['access']=="2" ) {
echo 'You are logged on as Manager';
}
if($_SESSION['access']=="1" ) {
echo 'You are logged on as Restricted user';
}
?>
restrictaccess.php, header.php and footer.php is included on every page accept login.php.
Both header and footer also includes restrictaccess.php; will this cause any problem ? Is there anyway so that such includes will only be loaded once ?
Currently when someone logon the message "You are loged on as Manager/Restricted user" is displayed thrice.
Your help will be much appreciated, thank you.