1
我把變量電子郵件地址和密碼從POST到GET這樣要通過PHP的GET
部分我handle_login_form.php的保持登錄狀態的URL
header("Location: /codes/index.php?ask_question&" . "email=" . $_POST['email'] . "&" . "passhash_md5=" . md5($_POST['password']));
然後用戶點擊關於鏈接。他應該在url中擁有登錄信息,但他沒有。他只有index.php?about&
。
我的index.php
if (isset($_GET['email'])) {
echo ("<li><a href='?about&email='" .
$_GET['email'] .
"&passhash_md5" .
$_GET['passhash_md5'] .
">About</a></li>");
} else {
echo "<li><a href='?about'>About</a></li>";
}
這是正在發生的事情
STEP | handle_login_form.php index.php?email&passhash_md5 index.php?about&
protocol | POST -> GET -> GET
----------------------------------------------------------------------------------
variables | password passhash_md5 passhash_md5
| email email email
Problem HERE!
非常感謝您觀察我的錯誤! - 我使用Vim。我很想擁有一些插件,這個插件提醒我逃跑並以某種方式提醒我使用錯誤的引用。如果你知道一些,請評論。 – 2009-08-09 20:22:07