note 35307 rejected from function.session-destroy by vincent

From: Date: Wed, 27 Aug 2003 07:11:41 +0000
Subject: note 35307 rejected from function.session-destroy by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55159@lists.php.net to get a copy of this message
Note Submitter: garyng818@hotmail.com ---- This is my logout code, but it doesnt run, can anyone help? <?php require_once('Connections/login.php'); ?> <?php session_start(); $user = $HTTP_SESSION_VARS['MM_Username']; mysql_select_db($database_login, $login); $query = "SELECT link FROM tb_status WHERE Name = '$user'"; $result = mysql_query($query); $link_array = mysql_fetch_assoc($result); do { foreach ($link_array as $val) { echo $val . "<br>"; } } while ($link_array = mysql_fetch_assoc($result)); ?> <?php session_start(); if ($Submit){ // Initialize the session. // If you are using session_name("something"), don't forget it now! // Unset all of the session variables. $_SESSION = array(); // Finally, destroy the session. session_destroy(); header("location:login.php"); } echo "<input type='submit' name='Submit' value='Submit'>"; ?>

« previous php.notes (#55159) next »