下面的代碼的隨機頁的輸出是:
print $_SESSION['uid']; // logged in user
// Get Data .
$uid = $_GET['ID']; // part of random page processing
print $_SESSION['uid'];
是:
1
2
我的登錄用戶ID被改變! :@
的登錄密碼(驗證)頁面是這樣的:
// Authenticate
$query = "SELECT * FROM User WHERE Email = '".$Email."' AND Password = '".$Password."'";
$result = mysql_query($query);
// Authenticated?
if(mysql_num_rows($result)) {
// Yes
// Set session Vars
$uid = mysql_result($result,0,ID);
$Access = mysql_result($result,0,Access);
session_destroy();
session_start();
$_SESSION['loggedIN'] = 1;
$_SESSION['Access'] = $Access;
$_SESSION['uid'] = $uid;
// Print a successful login and redirect
順便說一下,'session_destroy'不會刪除'$ _SESSION'數組。這是一個已知的錯誤。 – 2010-01-17 02:06:57
真的嗎? :o那麼清除任何變量的正確程序是什麼? – Bojack 2010-01-17 02:18:43