[eluser]thephpx[/eluser]
Hi guys,
Do not know if it will help or not but I was getting the same kinda error.
<-- CODE START -->
function addlession(){
$this->template->type('back');
$this->template->set('admin');
$this->template->load('top', $page);
$this->template->load('lessonsadd', $page);
$this->template->load('bottom');
if(count($_POST) > 1)
{
//do things.
}
}
<-- CODE END -->
upon posting the values to this same function it was showing "Cannot modify header information - headers already sent by...". Loading the template files after the if statement seems to fixed this problem.
In my case it happened because the header was already sent while parsing the templates, not because of any white-space but yes 99% case it happens because of 1 extra line before <?php or after ?> tag.
So to solve this issue I loaded the templates after the if statement
<-- CODE START -->
function addlession(){
$this->template->type('back');
$this->template->set('admin');
if(count($_POST) > 1)
{
//do things.
}
$this->template->load('top', $page);
$this->template->load('lessonsadd', $page);
$this->template->load('bottom');
}
<-- CODE END -->
take care,
faisal