CodeIgniter Forums
Session related Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Session related Error (/showthread.php?tid=35982)



Session related Error - El Forum - 11-17-2010

[eluser]adekenny[/eluser]
Hi,

I just used codeigniter to develop a Content Management System (CMS) which is working fine but there is this error that always show at the top of the pages. Please below:

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/t11kaca/public_html/system/application/models/edit_content.php:66)

Filename: libraries/Session.php

Line Number: 282



I've tried all i know to remove it but i don't even kwno what was causing the error. The error is actually causing the session to be destroyed by itself.

Anyone got an idea of what i need to do.

Thanks
Kenny


Session related Error - El Forum - 11-17-2010

[eluser]WanWizard[/eluser]
Check what's on line 66 of edit_content.php.

It's that line that is producing output, thus causing the error.


Session related Error - El Forum - 11-17-2010

[eluser]adekenny[/eluser]
there is nothing on edit_content: line 66. It just the closing tag for PHP. please see below.

function update_contact_us($wording)
{
$this->db->query("UPDATE contact_us set wording='$wording' WHERE dataid='2'");
return $this->db->affected_rows();
}

}
?>
: line 66


As you can see, line 66 just closed the PHP tag.


Session related Error - El Forum - 11-17-2010

[eluser]Learn CodeIgniter[/eluser]
Make sure you have no white space.

remove the closing ?>


Session related Error - El Forum - 11-17-2010

[eluser]adekenny[/eluser]
It worked....HURRAY!!!!!!

Many Thanks