Location: PHPKode > projects > Helpdesk Over Web > how/logout.php
<?php # Script 12.8 - logout.php
// This is the logout page for the site.

// Include the configuration file for error management and such.
require_once ('includes/config.inc'); 

// Set the page title and include the HTML header.
$page_title = 'Logout';
include_once ('includes/header.html');

// If no full name variable exists, redirect the user.
if (!isset($_SESSION['FullName'])) {

	header ("Location:  /how/index.php");
	ob_end_clean(); // Delete the buffer.
	exit(); // Quit the script.
	
} else { // Logout the user.

	$_SESSION = array(); // Destroy the variables.
	session_destroy(); // Destroy the session itself.
	setcookie (session_name(), '', time()-300, '/', '', 0); // Destroy the cookie.

}

// Print success message.
echo "<H3>Logout Complete.</H3>";
echo "<P>Your session is now closed.";
echo "<H4>[ <A HREF='index.php'>Main</A> ]</H4>";
?>
<P><BR><P>
<?php
include ('includes/footer.html'); // Include the HTML footer.
?>
Return current item: Helpdesk Over Web