作者costbook (CB)
看板PHP
標題網頁不會自動重新載入 ... 用header("Location:*")
時間Tue Aug 29 21:13:26 2006
很奇怪,按下登出後的確是登出了,
可是不會重新載入
一開始我是這樣寫:
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
1F:推 alpe:絕對路徑 08/29 21:29
3F:推 alpe:用 $_POST["submit"] 吧. $HTTP_*_VAR 快不行用了 08/29 22:57
4F:→ alpe:還有 @ 在那一整個沒意義 08/29 22:58
5F:推 costbook:把 $_POST['']==* 放在if裡面會出錯 08/30 00:45
6F:推 wa120:用javascript改寫吧...用PHP改標頭檔很容易出問題 08/31 00:24