【问题标题】:syntax error, unexpected end of file codeigniter view [duplicate]语法错误,文件codeigniter视图意外结束[重复]
【发布时间】:2018-12-25 01:02:26
【问题描述】:

遇到未捕获的异常类型:ParseError 消息:语法错误,文件意外结束 文件名: C:\xampp\htdocs\clinic-master\application\views\login_view.php 行号:62 回溯: 文件:C:\xampp\htdocs\clinic-master\application\controllers\Login.php 行数:18 功能:查看 文件:C:\xampp\htdocs\clinic-master\index.php 行:315 功能: 需要一次

我在查看codeigniter时出现错误,当我在linux中运行并且可以运行时,但是当我在windows中运行时出现这样的错误

下面是我的login_view

    <!DOCTYPE html>
<html>
<head>
<meta name="keyword" content="">
<link rel="shortcut icon" href="<?php echo base_url(); ?>img/logo-icon.png">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Q-Clinic</title>

<link href="<?php echo base_url(); ?>css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>css/bootstrap-reset.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>css/style-responsive.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>js/sweetalert2.css">
<script src="<?php echo base_url(); ?>js/sweetalert2.min.js"></script>
<?php 
if ($this->session->flashdata('salah')) { ?>
<script>
    swal({
        title: "Gagal",
        text: "<?php echo $this->session->flashdata('salah'); ?>",
        timer: 3000,
        showConfirmButton: false,
        type: 'error'
    });
</script>
<? } ?>    
</head>

<body class="login-body">
    <div class="container">
        <br><br><br>    
        <div align="center">
            <img src="<?php echo base_url(); ?>img/logo.png">            
        </div>

        <form class="form-signin" action="<?php echo base_url('login/cek_login'); ?>" name="login" method="post">
            <h2 class="form-signin-heading">Masukkan User & Password :</h2>
                <div class="login-wrap">            
                    <input id="username" type="text" class="form-control" name="username" placeholder="Username Anda" autofocus required>
                    <input type="password" class="form-control" placeholder="Password Anda" name="password"  required>
                    <button class="btn btn-lg btn-login btn-block" type="submit">Login</button>
               </div>            
        </form>

        <?php 
        if ($this->session->flashdata('notification')) { 
        ?>
            <div class="form-body">
                <div class="alert alert-block alert-success fade in" align="center">
                    <?php echo $this->session->flashdata('notification'); ?>
               </div>               
            </div>
        <?php 
        } 
        ?>       
    </div>

    <script src="<?php echo base_url() ?>js/jquery.js"></script>
    <script src="<?php echo base_url() ?>js/bootstrap.min.js"></script>
</body>
</html>

【问题讨论】:

  • 我相信有时使用

标签: php html ajax codeigniter codeigniter-3


【解决方案1】:

希望对您有所帮助:

&lt;/script&gt; 标签之后

替换这个

<? } ?>     

用这个:

<?php } ?>  

应该是这样的:

<script>
    swal({
        title: "Gagal",
        text: "<?php echo $this->session->flashdata('salah'); ?>",
        timer: 3000,
        showConfirmButton: false,
        type: 'error'
    });
</script>
<?php } ?>  

【讨论】:

  • 快乐是我的,快乐的编码
猜你喜欢
  • 2012-12-09
  • 2017-06-25
  • 1970-01-01
  • 1970-01-01
  • 2013-06-08
  • 2020-07-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多