I got this error message when i run my php CodeIgniter project:
A PHP Error was encountered
Severity: Warning
Message: Cannot modi
You can't display anything before the header function is called. You should not display anything form model or controller to avoid this kind of error. If you want to display something form the controller or model then you should store the output to the buffer instead of sending it to the browser. You can store the output to the buffer using ob_start()
function before header()
function is called. Then you can do something like this
if(true)
{
header("Location:http://google.com");
}
else
{
ob_end_flush();
}