Location: PHPKode > projects > PHP MySQL Address Book > addressbook/logout.php
<?php
//require("links.php");
// i will keep yelling this
// DON'T FORGET TO START THE SESSION !!!
session_start();

// if the user is logged in, unset the session
if (isset($_SESSION['db_is_logged_in'])) {
	unset($_SESSION['db_is_logged_in']);
}
if (isset($_SESSION['usr_level'])) {
	unset($_SESSION['usr_level']);
}
if (isset($_SESSION['usr_id'])) {
	unset($_SESSION['usr_id']);
}
if (isset($_SESSION['usr_nam'])) {
	unset($_SESSION['usr_nam']);
		
}
if (isset($_SESSION['isEnabled'])) {
	unset($_SESSION['isEnabled']);
}

// now that the user is logged out,
// go to login page
header('Location: index.php');
?>
Return current item: PHP MySQL Address Book