Cannot modify header information – headers already sent by

Hi i have an error on my Codeigniter :

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\PROJECT_TEMP\evaluasiTIK_HG\application\modules\rss\controllers\feed.php:25)

Filename: controllers/feed.php

Line Number: 21

feed.php:

<?php
class Feed extends Controller 
{

    function Feed()
    {
        parent::Controller();
        $this->load->model('posts_model', '', TRUE);
        $this->load->helper('xml');
    }

    function index()
    {
        $data['encoding'] = 'utf-8';
        $data['feed_name'] = 'DerekAllard.com';
        $data['feed_url'] = 'http://www.syslog-center.net/theme/theme2/syslog.xml';
        $data['page_description'] = 'Code Igniter, PHP, and the World of Web Design';
        $data['page_language'] = 'en-ca';
        $data['creator_email'] = 'Derek Allard is at derek at derekallard dot com';
        $data['posts'] = $this->posts_model->getRecentPosts();
        header("Content-Type: application/rss+xml");
        view('rss/feed', $data);
    }
}
?> 

Anyone can help me. please :)

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories