标头:位置不工作


header:location not working

由于某种原因,我遇到了问题,我的头重定向似乎不起作用。

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

试试这个:

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

嗯,试试

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

而不是

if(!session_is_registered(myusername)){