logout page with redirect back page

 <?php

include 'checkLogin.php';
if (!$admin) {
header("location:./"); // not admin redirect to home page 
}
else // if admin destroy the session logouted and redirected to homepage 
{
    if(isset($_SERVER['HTTP_REFERER'])) 
    {
      $user_referer_link = $_SERVER['HTTP_REFERER'];
    }
session_start();  
session_unset();
session_destroy();
header("location:$user_referer_link");
}
?>

Post a Comment

0 Comments