note 35306 added to function.session-destroy
| From: | garyng818 at hotmail dot com | Date: | Wed, 27 Aug 2003 04:40:05 +0000 |
| Subject: | note 35306 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-55151@lists.php.net to get a copy of this message | ||
This is my logout code.. why it doesnt work? anyone can please help me?
<?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'>";
?>
----
Manual Page -- http://www.php.net/manual/en/function.session-destroy.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35306
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35306&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35306&report=yes