i want to make a function to check login or not. but when i run, there’s an error. the error is undefined index email and pass at the session variable. please help
script:
function cek_login(){
$hasil = 0;
$mail = $_SESSION['email'];
$pass = $_SESSION['pass'];
if (!empty($mail) and !empty($pass)){
$hasil = 1;
}
return $hasil;
}