标题:位置无效

时间:2013-07-28 22:12:51

标签: php http-headers

我有点理由遇到这个问题,我的标题重定向似乎不起作用。

<?php
   session_start();
   if(!session_is_registered(myusername)){
      header('Location:home.php');
      exit;
   }
?>

<html>
   <body>
      Login Successful
   </body>
</html>

2 个答案:

答案 0 :(得分:0)

试试这个:

header("Location: home.php"); // there is a space

答案 1 :(得分:-1)

嗯,试试

if(!isset($_SESSION['myusername'])){

而不是

if(!session_is_registered(myusername)){