I ran a test and I put a way to identify when the user is logged into the site, and this is working well. But when I uncheck and go to the index, which is the page that I put the code, the error appears
Notice: Undefined index: level in C: \ Program Files (x86) \ EasyPHP-DevServer-14.1VC9 \ data \ localweb \ site tcc \ index.php on line 5
I wanted to know a way to get this out of the way, and only the message I posted to users who logged in would appear. Code I've used
<?php
session_start();
include "php/conexao.php";
if($_SESSION['nivel'] == "admin" || $_SESSION['nivel']== "usuario"){
echo "oi logado";
}
?>