[eluser]Unknown[/eluser]
Hi all,
I'm new to this forum and this is my first post, it is a really simple problem. Each time I attempt to load the session class in any of my controllers and then load a view, I get a "cannot modify header information error" in this view.
Example
Code:
<?php
class Example extends CI_Controller {
public function Example()
{
parent::__construct();
$this->load->library('session');
}
public function index()
{
$this->session->set_userdata('user','examplename');
$user = $this->session->get_userdata('user');
$this->load->view("example_view", array('name'=>$user));
}
}
?>
Now if I were to run this script, I will get an error similar to
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\...\example.php:6)
Filename: libraries/Session.php
Line Number: 686
The view loads, but I would really want to remove this message from it. If you have any idea about its cause please let me know
Thanks