Location: PHPKode > scripts > SelectaPix Image Gallery > admin/logout.php
<?php
/* +----------------------------------------------------------------------+
   |SelectaPix Open Source Gallery	                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 2004 OutOfTheTrees			                          |
   |                                                                      |
   | http://www.outofthetrees.co.uk/index.php                             |
   | 												                      |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.0 of the GPL license,       |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.outofthetrees.co.uk/license/2_0.txt.                      |
   | If you did not receive a copy of the SelectaPix license and are 	  |
   | unable to obtain it through the world-wide-web, please send a note   |
   | to hide@address.com so we can mail you a copy immediately.|
   +----------------------------------------------------------------------+ */
require_once("includes/inc_global_fns.php");
session_start();
@$old_user = $_SESSION['valid_user'];  // store  to test if they *were* logged in
$result_dest = session_destroy();
do_html_header(SITE_NAME." - Admin");
echo '<p>&nbsp;</p>';
do_html_heading("Logging Out");
echo "<div class=\"margins\">\n";
if (!empty($old_user)) {
	if ($result_dest) {
		// if they were logged in and are now logged out
		echo '<p class="goodnews">You have been logged out of the system. Thank you.<br />';
		do_html_url("index.php", "&lt;&lt; Login again");
		echo ' or ';
		do_html_url(SITE_URL.SITE_DIR, SITE_NAME." &gt;&gt;");
		echo '</p>';
	}
	else {
		// they were logged in and could not be logged out
		echo '<p class="badnews">Sorry you could not be logged out.<br />';
		echo 'Please be sure to close your browser window when your session.<br />';
		do_html_url("index.php", "&lt;&lt; Login again");
		echo ' or ';
		do_html_url(SITE_URL.SITE_DIR, SITE_NAME." &gt;&gt;");
		echo '</p>';
	}
}
else {
	// if they weren't logged in but came to this page somehow
	echo '<p class="badnews">You were not logged in, and so have not been logged out.<br />';
	do_html_url("index.php", "&lt;&lt; Login");
	echo ' or ';
	do_html_url(SITE_URL.SITE_DIR, SITE_NAME." &gt;&gt;");
	echo '</p>';
}
?>
</div>
</div>
<?php
do_html_footer('1', 'nokwikenav');
?>
Return current item: SelectaPix Image Gallery