I have following type of error in codeigniter, I am unable solve it any one have idea what is cause of this error.
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at    /home/samples1/public_html/venture-test/application/controllers/admin/admin_notifications.php:158)
Filename: helpers/url_helper.php
Line Number: 540
I used two methods both are in same controllers as bellow.
 <?php
    public function approve_recent_user() {  
    $user_id = $this->uri->segment(4);
    $notification_id = $this->uri->segment(5);
    $status = 1;
    if($this->admin_notification_db->user_approve_flag($user_id,$status) == true) {
     redirect('admin/admin_notifications/unapproved_users');                
    }
    else {
        redirect('admin/admin_home');
    }
} ?>
after execution of this function I redirect on fo another methods as bellow.
<?php 
 public function unapproved_users() {        
    $result = $this->admin_notification_db->get_unapproved_users();
    $data['users'] = $result; 
    $this->load->view('admin/recent_users', $data); 
 } ?>
 
    