2012-07-13 91 views
0

header("Location: …");似乎並不奏效:HTTP與頭功能重定向不起作用

<?php 
session_start(); 
if (isset($_SESSION['user'])){ 
?> 
<html> 
<head> 
    <title> 
    Admin Panel 
    </title> 
</head> 
<body> 

</body 
</html> 
<?php 
} else { 
    header("Location: http://echo2.site40.net/cms/admin/login.php"); 
} 
?> 
+3

你可以定義_not working_?你有什麼錯誤嗎? – Florent 2012-07-13 14:24:33

+0

不只是不會去登錄頁面,它必須becuae會話沒有設置 – user1523770 2012-07-13 14:35:54

+0

那麼,'$ _SESSION ['用戶']'可能未定義... – Florent 2012-07-13 14:39:18

回答

0

似乎是工作,如果我正好複製粘貼代碼...

仍然尋找空白 - 開始之前的空間<?php