I am using the following code to check the user permission (User Role).
This is to check whether the user is logged in or not
<?php
session_start();
if (!isset($_SESSION["username"])) {
echo '<script>window.location.href = "userLogin/?notloggedin=true";</script>';
}
?>
This is to check whether is an admin or not
<?php
session_start();
if ($_SESSION["user_group"] == 'admin') {
//Display the current page.
}
else
{
//display an full page error without showing any other content in the current page.
}
?>
My question is, how can I display a full page error instead of page content?