Php 如何修复我的主页关闭标记出错?

Php 如何修复我的主页关闭标记出错?,php,html,Php,Html,这张表格是我的主页。登录后,我无法进入主页 因为这个错误 分析错误:语法错误, 第28行的C:\xampp\htdocs\kusina\u online\home.php 库西纳在线 库西纳在线 你好, PHP返回此错误,因为您没有正确结束if语句。如果您这样做,您的代码将如下所示: if(!isset($_SESSION['login_user'])) { header("location: index.php"); } 或者,如果您只需要运行一行代码,您可以将其格式化如下 i

这张表格是我的主页。登录后,我无法进入主页 因为这个错误

分析错误:语法错误,
第28行的C:\xampp\htdocs\kusina\u online\home.php


库西纳在线


库西纳在线
你好,
PHP返回此错误,因为您没有正确结束if语句。如果您这样做,您的代码将如下所示:

if(!isset($_SESSION['login_user'])) {
    header("location: index.php");
}
或者,如果您只需要运行一行代码,您可以将其格式化如下

if(!isset($_SESSION['login_user']))
    header("location: index.php");

你可以在这里查阅

<?php          
include('session.php');

if(!isset($_SESSION['login_user'])) {
    header("location: index.php");
}   // you not closing this statement.
?>  
<DOCTYPE! html>
<html lang="en"> 
  <head>  
        <title>Kusina Online</title>  
        <meta charset="utf-8">  <!--- maybe a typo why would `/` be here.---> 
        <meta name="viewport" content="width=device-width, initial- scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="style.css">
        <script type="text/javascript" src="bootstrap/js/jquery-slim.min.js"></script>
        <script type="text/javascript" src="bootstrap/js/popper.min.js"></script>
        <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>  
  </head>  
  <body>  
       <br /><br />  
       <div class="container" style="width:500px;">  
             <h3 align="center">Kusina Online</h3>  
            <br /> 
            <b id="welcome">Howdy, <i><?php echo $login_session; ?></i></b>
            <div class="desc"><b id="logout"><a href="logout.php">Log Out</a></b></div>
       </div>  
  </body>

库西纳在线


库西纳在线
你好,


确保检查每一行

您应该在第6行中放置一个闭合括号

<?php          
include('session.php');

if(!isset($_SESSION['login_user'])) {
    header("location: index.php");
} 
?>  

您忘记关闭第6行中的括号

<?php  
    include('session.php');

    if(!isset($_SESSION['login_user'])) {
        header("location: index.php");
 ?>  
<DOCTYPE! html>
<html lang="en"> 
      <head>  
            <title>Kusina Online</title>  
            <meta charset="utf-8"/>
            <meta name="viewport" content="width=device-width, initial- scale=1, shrink-to-fit=no">
            <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
            <link rel="stylesheet" type="text/css" href="style.css">
            <script type="text/javascript" src="bootstrap/js/jquery-slim.min.js"></script>
            <script type="text/javascript" src="bootstrap/js/popper.min.js"></script>
            <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>  
      </head>  
      <body>  
           <br /><br />  
           <div class="container" style="width:500px;">  
                 <h3 align="center">Kusina Online</h3>  
                <br /> 
                <b id="welcome">Howdy, <i><?php echo $login_session; ?></i></b>
                <div class="desc"><b id="logout"><a href="logout.php">Log Out</a></b></div>
           </div>  
      </body>
</html>

库西纳在线


库西纳在线
你好,
亲爱的!基本的你的收尾牌在哪里?
<?php  
    include('session.php');

    if(!isset($_SESSION['login_user'])) {
        header("location: index.php");
 ?>  
<DOCTYPE! html>
<html lang="en"> 
      <head>  
            <title>Kusina Online</title>  
            <meta charset="utf-8"/>
            <meta name="viewport" content="width=device-width, initial- scale=1, shrink-to-fit=no">
            <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
            <link rel="stylesheet" type="text/css" href="style.css">
            <script type="text/javascript" src="bootstrap/js/jquery-slim.min.js"></script>
            <script type="text/javascript" src="bootstrap/js/popper.min.js"></script>
            <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>  
      </head>  
      <body>  
           <br /><br />  
           <div class="container" style="width:500px;">  
                 <h3 align="center">Kusina Online</h3>  
                <br /> 
                <b id="welcome">Howdy, <i><?php echo $login_session; ?></i></b>
                <div class="desc"><b id="logout"><a href="logout.php">Log Out</a></b></div>
           </div>  
      </body>
</html>