Cannot modify header information - headers already sent |
Hi! I'm using CodeIgniter for quite awhile now..and I'm currently facing an error
Code: A PHP Error was encountered This is Line 75 of My_Controller PHP Code: if( ! $this->session->email || $this->session->email == NULL || $this->session->isLoggedIn !== TRUE) { just incase this is needed, I used echo in my User controller because this is where I get some ajax request. Thank you very much ![]()
UPDATE:
I just found out that this one might be the one causing problem. PHP Code: $data['pending_count'] = ($pending->count * $pending->pages); I cannot use redirect(site_url('login')); below this code. But if I put redirect before $data[] it works just fine. Is there any way I can solve my error? Thank you! ![]()
You get the headers already sent error because you have written to the output already.
Which is most Lilly what the $data is doing. So yes you would need to redirect before you write the $data to the view. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |