-1
if ($_SESSION['user']['role_access'] == 1)
{
  echo '<ul><li><a href="admin/index.php">Admin Site<i class="icon-cogs"></i></a></ul></li>';
}

but when I log out then there's this error?
Notice: Undefined index: user in C:\Xampp\htdocs\xampp\site\includes\menu.php on line 73

Can not make it to do nothing when i log out? It will only remove the Admin site when i log out.

Suresh Kamrushi
  • 15,627
  • 13
  • 75
  • 90

2 Answers2

2

instead

if ($_SESSION['user']['role_access'] == 1)

Try like this:

if (isset($_SESSION['user']['role_access']) && $_SESSION['user']['role_access'] == 1)
Suresh Kamrushi
  • 15,627
  • 13
  • 75
  • 90
0

Simple:

if (isset($_SESSION['user']['role_access'])== 1)