标题已发送错误 - 有时使用某些浏览器

时间:2015-04-12 10:36:08

标签: codeigniter

  

严重性:警告

     

消息:无法修改标题信息 - 已经发送的标题(输出从/hermes/bosoraweb095/b1793/ipg.orangetechcomnp/projects/Himalayan/application?/controllers/activity.php:1开始)

     

文件名:libraries / Session.php

     

行号:416

最可能的原因是因为我研究过以下事项:

  1. 之前的空格或空格
  2. 文件编辑器的UTF 08问题 - 我检查过,这不是问题。

  3. 使用回声 - 我没有使用回声,但错误在第1行。

  4. 注意 - 我尝试使用Opera,Chrome和Firefox,奇怪的是错误有时会出现在歌剧中,有时会出现在Chrome中,有时候会出现在Firefox中,有时甚至会出现。

    当它在Chorome上运行良好时,Firefox中会显示错误。当我刷新时,再次显示错误消息。

    我的CodeIgnitor代码:

        <?php
        class activity extends CI_Controller {
        const VIEW_FOLDER = 'activity/activity';    
        public function __construct(){
        parent::__construct();
        $this->load->model('activity_model');
        $this->load->model('testimonial_model');
         }
    function index()
    {
    
        $id=$this->uri->segment(3);
        $data= array(
    
            'activity_list'=> $this->activity_model->get_activity_id($id),
            'recent_list'=> $this->activity_model->get_recent(),
            'popular_list'=> $this->activity_model->get_popular(),
            'testimonial_list'=> $this->testimonial_model->get_testimonial(),
            'category_list'=> $this->activity_model->get_category_id($id),
            //'pagination' => $this->pagination->create_links(),            
            );
    
            $this->load->view('includes_frontend/header');
            $this->load->view('includes_frontend/menu');
            $this->load->view('activity/detail_activity',$data);    
            $this->load->view('includes_frontend/footer',$data);
    
    }
    
    function main_activity(){
    
    
     //pagination settings
        $config['per_page'] = 8;
        $config['uri_segment']=4;
        $config['base_url'] = base_url().'activity/main_activity';
        $config['use_page_numbers'] = TRUE;
        $config['num_links'] = 20;
        $config['full_tag_open'] = '<ul class="pagination">';
        $config['full_tag_close'] = '</ul>';
        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li class="active"><a>';
        $config['cur_tag_close'] = '</a></li>';
        $config['next_tag_open'] = '<li>';
        $config['next_tag_close'] = '</li>';
        $config['prev_tag_open'] = '<li>';
        $config['prev_tag_close'] = '</li>';
    
        //limit end
        $page = $this->uri->segment(4);
    
        //math to get the initial record to be select in the database
        $limit_end = ($page * $config['per_page']) - $config['per_page'];
        if ($limit_end < 0){
            $limit_end = 0;
        } 
    
    
            //fetch sql data into arrays
            $data['count_activity']= $this->activity_model->count_activity();
           // $data['activity'] = $this->activity_model->get_activity($config['per_page'],$limit_end);        
            $config['total_rows'] = $data['count_activity'];
    
    
    
            $data= array(
    
            'activity_list'=> $this->activity_model->get_activity($config['per_page'], $limit_end),
            //'pagination' => $this->pagination->create_links(),
            'testimonial_list'=> $this->testimonial_model->get_testimonial(),
    
            );$this->pagination->initialize($config);
            $this->load->view('includes_frontend/header');
            $this->load->view('includes_frontend/menu');
            $this->load->view('activity/activity',$data);   
            $this->load->view('includes_frontend/footer',$data);    
    
        }
    

    }

1 个答案:

答案 0 :(得分:0)

这将是一个白色空间问题。检查控制器和模型,看看文件的开头和结尾是否有空格。