Welcome Guest, Not a member yet? Register   Sign In
Sesion already sent problem

[eluser]new developer[/eluser]
I have a problem saying session headers already sent. I worked the same code on Wamp but i installed Xampp recently. It gives me an error. My code is really simple as below. Can anyone please help me rectify this.

class Welcome extends Controller {

    function Welcome()

    function index(){
    $data['main'] = 'adminLogin';
      $data['title']= 'Welcome to my first aplication';

      function verifyMe(){
      $u = $this->input->post('username');
      $p = $this->input->post('password');
      $this-> MAdmins-> verifyUser($u,$p);
    if ($_SESSION['userid'] > 0){
         $this-> session-> set_flashdata(error  , 'Login failed');


I don't know if this is still relevant, but I was having a similar problem for a while this morning. My issue was a blank link under my closing php tag at the end of my user_model.php file. For some reason that blank line got rendered as display data and those the headers were thrown.

I would go with jwindhorst.
I don't see anything else where you are sending any data to the browser that would cause the error.
Make sure there's no white space anywhere after the PHP closing or opening tags.

That's why I follow CodeIgniter's footsteps and don't use a closing ?> tag in my controllers, libraries, models, hooks, etc..

The only place I use the closing tag is in my views (if my views contain php).

Theme © iAndrew 2016 - Forum software by © MyBB