網頁不會自動重新載入 ... 用header("Location:*")

看板PHP作者 (CB)時間19年前 (2006/08/29 21:07), 編輯推噓5(501)
留言6則, 3人參與, 最新討論串1/1
很奇怪,按下登出後的確是登出了, 可是不會重新載入 一開始我是這樣寫: function reLoadWeb($direction){ if($direction=="") $direction="./"; header("Location:$direction"); } if(@$HTTP_POST_VARS['submit']=="登出") { session_unset(); session_destroy(); reLoadWeb($file); } 後來改成這樣: if(@$HTTP_POST_VARS['submit']=="登出") { session_unset(); session_destroy(); header("Location:login.php"); } 還是不行... 我有試過單獨一個header("Location:*"); 結果是ok的 -- 我認識的人愈多,我就愈喜歡狗 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.139.180.193

08/29 21:29, , 1F
絕對路徑
08/29 21:29, 1F

08/29 22:06, , 2F
是說 http://.../login.php 嗎?還是不行耶
08/29 22:06, 2F

08/29 22:57, , 3F
用 $_POST["submit"] 吧. $HTTP_*_VAR 快不行用了
08/29 22:57, 3F

08/29 22:58, , 4F
還有 @ 在那一整個沒意義
08/29 22:58, 4F

08/30 00:45, , 5F
把 $_POST['']==* 放在if裡面會出錯
08/30 00:45, 5F

08/31 00:24, , 6F
用javascript改寫吧...用PHP改標頭檔很容易出問題
08/31 00:24, 6F
文章代碼(AID): #14z3mlLU (PHP)
文章代碼(AID): #14z3mlLU (PHP)