Php CodeIgniter头部为空且内容物在体内

Php CodeIgniter头部为空且内容物在体内,php,html,codeigniter,frameworks,codeigniter-3,Php,Html,Codeigniter,Frameworks,Codeigniter 3,嘿,我不明白我的网站不起作用,我没有做任何事,所以我会解释 我现在在我的页面顶部得了0分! 谷歌浏览器浏览器: View/header.php:https://pastebin.com/7GqFYR75 View/homepage.php:https://pastebin.com/3htmFSmw View/footer.php:https://pastebin.com/b3X9KScg Controller/View.php:https://pastebin.com/cxCdcdEQ Chr

嘿,我不明白我的网站不起作用,我没有做任何事,所以我会解释

我现在在我的页面顶部得了0分! 谷歌浏览器浏览器:

View/header.php:https://pastebin.com/7GqFYR75

View/homepage.php:https://pastebin.com/3htmFSmw

View/footer.php:https://pastebin.com/b3X9KScg

Controller/View.php:https://pastebin.com/cxCdcdEQ

Chrome浏览器代码:https://pastebin.com/Q8VYja5u

我已经检查了编码UTF-8,我已经重新编码UTF-8与我的崇高文本,但没有改变。。。需要帮助吗


编辑:修复了我猜未关闭的HTML标记导致此问题的原因。我在View/header.php中发现了一些未关闭的HTML标记。关上它。试试这个

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <!--o-->
        <?php
        //Session
        $customer_id = $this->session->userdata('customer_id');
        $user_type = $this->session->userdata('user_type');
        $statement = $this->session->userdata('timezone');

        ?>
        <!--o-->
        <link rel="icon" type="image/png" href="<?php echo base_url('images/favicon.png'); ?>" />
        <meta name="author" content="Wise Men Trade" />
        <meta name="copyright" content="Copyright Notice ©2015 WisemenTrade Limited and licensors. All rights reserved." />
        <meta name="robots" content="all" />
        <!--o-->
        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <!-- Bootstrap CSS -->
        <link href="<?php echo base_url("css/bootstrap.min.css"); ?>" rel="stylesheet"/>
        <!-- Basic CSS -->
        <link href="<?php echo base_url("css/style.css"); ?>" rel="stylesheet"/>
        <!-- Responsive CSS -->
        <link href="<?php echo base_url("css/responsive.css"); ?>" rel="stylesheet"/>
        <!-- Important Owl stylesheet -->
        <link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.carousel.css"); ?>"/>
        <!-- Default Theme -->
        <link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.theme.css"); ?>"/>
        <!-- MS DROP DOWN -->
        <link rel="stylesheet" href="<?php echo base_url('css/msdropdown/flags.css'); ?>"/>
        <link rel="stylesheet" href="<?php echo base_url('css/msdropdown/dd.css'); ?>"/>

        <!-- Google Analytics -->
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

            ga('create', 'UA-62333409-1', 'auto');
            ga('send', 'pageview');
        </script>
        <!-- End Google Analytics -->

    </head>

<body>
<!--top-header-->
    <header>
        <div class="header_block">
            <!-- left -->
            <div class="block_left">
                <a href="<?php echo base_url(); ?>">
                    <img src="<?php echo base_url("images/log_wmt.png"); ?>" class="logo" width="130" height="130" alt="Logo Wise Men Trade" />
                </a>
            </div>
        </div>
    </header>


根据文档(),您可以在控制器中加载多个视图,我认为如果在视图中加载它是不起作用的,因此您应该有如下内容:

<?php

class Page extends CI_Controller {

        public function index()
        {
                $data['page_title'] = 'Your title';
                $this->load->view('header');
                $this->load->view('menu');
                $this->load->view('content', $data);
                $this->load->view('footer');
        }

}

我认为您需要在控制器中加载视图,而不是视图,因此您应该有如下内容:$this->load->view('header')$此->加载->查看('homepage',$data);在你的f$flash\u月,你有很多数据库$query,它们应该在一个模型函数中,然后通过控制器来查看。我已经测试了删除主页中的所有代码,页面顶部的零号仍然在这里。。。在我的footer.php中it@Gentech-Digital,View/header.php(
中未关闭的HTML标记如何)。同样在你看来(
)是的,它在我的代码的其余部分关闭了。我将在我的原始帖子中更新我的答案,我已经编辑了view/header.php代码部分。还有未关闭的meta和tag。试试看。如果还有问题的话。尝试从浏览器使用键盘浏览页面以查看源代码。将其粘贴到粘贴箱中进行疑难解答。查看我的原始帖子我更新了文件的所有内容是的,我有注释元,因为我在doctype之前加载了,但我在页面顶部得到了一个零号检查原始帖子是否有chrome代码查看者检查文档匹配,我用了很多次,效果很好。都德问题是页面顶部检查中的0,因为您可以在页面顶部看到0。让我们尝试将此添加到控制器ini_集中(“显示错误”,1);
<?php

class Page extends CI_Controller {

        public function index()
        {
                $data['page_title'] = 'Your title';
                $this->load->view('header');
                $this->load->view('menu');
                $this->load->view('content', $data);
                $this->load->view('footer');
        }

}