Codeigniter:无法修改标头信息 - 已经发送的标头

时间:2014-12-10 06:16:03

标签: php codeigniter

我在线移动我的网站,但是当我编辑我的表数据时,我遇到了这样的错误,

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/shintiad/public_html/sociotraveler/application/views/template/index.php:20)

Filename: libraries/Session.php

Line Number: 688

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/shintiad/public_html/sociotraveler/application/views/template/index.php:20)

Filename: helpers/url_helper.php

Line Number: 542

我的template / index.php代码

<!DOCTYPE html>
<html lang="en">
  <head>
        <!-- Meta -->
        <?php $this->load->view('template/partial/meta');?>
        <!-- Meta -->
  </head>
  <body>
        <!-- Header -->
        <?php $this->load->view('template/partial/sidebar');?>
        <!-- Header -->

        <!-- Dynamic Content -->
        <div class="content">
        <?php $this->load->view("{$page_info->content}");?>
        </div>
        <!-- Dynamic Content -->

        <!-- Footer -->
        <?php $this->load->view('template/partial/footer');?>
        <!-- Footer -->
   </body>
  </html>

当我在我的localhost上运行时,一切都很好......请帮助,谢谢... *我以前检查过空白区域

1 个答案:

答案 0 :(得分:1)

请检查所有PHP文件并删除<?php标记之前的空格。如果有空格或新行,则启动http请求的正文,并且您无法向http请求添加新标题。