[eluser]bndk[/eluser]
Hey guys,
I'm currently creating a website where users will be able to browse the site in two different languages. If the user don't choose a language, I want a default language to be set.
The way I was thinking of doing this is to edit the Controller class' constructor like this using sessions:
Code:
if (!$this->session->userdata('language')) {
$this->session->set_userdata('language', 'english');
}
However, I get this error:
Quote:Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\some_site\system\core\Controller.php:57)
Filename: libraries/Session.php
Line Number: 672
I have two questions:
1. Why do I get the error?
2. Is my way of handling the default language-problem a good way do it? Please suggest other methods to do this.
Thanks!