Location: PHPKode > projects > WH Community > wh_community/signout.php
<?php require('layout/header.php'); ?>

    <script type="text/javascript">
    	function showSuccessMessage() {
    	showNotification({
    	type : "success",
    	message: "<?php echo $lang['success_signout']; ?>"
    	});    
        }                                
    
    function showErrorMessage() {
    	showNotification({
    	type : "error",
    	message: "<?php echo $lang['couldnot_signout']; ?>"
    	});    
        }                                
    </script>

<div id="content_wrapper">
    <div class="content"><?php

		echo '<h1>' . $lang['signout'] . '</h1><br>';
		
		if($_SESSION['signed_in'] == TRUE) {
		
    		$_SESSION['signed_in'] = NULL;
    		$_SESSION['user_name'] = NULL;
    		$_SESSION['user_id']   = NULL;
    		
    		$sql = "DELETE FROM
    					online
    				WHERE
    					DATE_SUB(NOW(), INTERVAL 1 MINUTE) > session_timed";
    		
    		mysql_query($sql) OR die(mysql_error());
		
		$autoforward = 3;
		
		echo '<p class="right">' . $lang['success_signout'] . '</p>
		      <p><meta http-equiv="refresh" content="' . $autoforward . '; URL=' . $index . '">
		      <small>(' . $lang['redirected_in'] . ' ' . $autoforward . ' ' . $lang['seconds'] . '...)</small></p>';
		echo "<script type=\"text/javascript\">showSuccessMessage();</script>";
		
			}else{
			
			echo '<p>' . $lang['couldnot_signout'] . ' - [ <a href="signin.php">' . $lang['signin'] . '</a> ]</p>';
			echo "<script type=\"text/javascript\">showErrorMessage();</script>";
			}
		
		close_connection();
		
		echo '<div class="spacer_div">&nbsp;</div>';

		?>
    </div>
</div>

<?php require('layout/footer.php'); ?>
Return current item: WH Community