Welcome Guest, Not a member yet? Register   Sign In
Undefined index / headers already sent by.. errors
#1

[eluser]Nouman6[/eluser]
Hey Guys,

decided to upload my current progress (everything running smoothly on localhost) to a subdomain in order to test it out again, and after configuring the database, routes, and such I get a new error I don't receive on my testbed localhost setup.

"Undefined index"
"headers already sent by"

I get these when trying to enter the user dashboard without first logging in. It is supposed to check for a session, and then take me to the login since I haven't set a session yet.

Here's the page with the errors:

http://work.grp.ly/dashboard

here's my members controller:

Code:
<?php

class Members extends Controller {
    function __construct()
    {
        parent::Controller();
        $statuscheck = $this->session->userdata['status'];
        if ($statuscheck != 'OK'){
            redirect('login/validate_login');
        };
    }

    function dashboard(){
        $data['main_content'] = 'dashboard/user_home';
        $this->load->view('dashboard/includes//template', $data);        
    }
    function logout(){
        $this->session->sess_destroy();
        $data['return_reason'] = 'Logout Successful';
        $this->load->view('login_view', $data);
    }
    
    function edit_profile(){
        $data['main_content'] = 'dashboard/edit_profile';
        $this->load->view('dashboard/includes//template', $data);    
    }

}

going from the main page http://work.grp.ly/and registering, logging in, logging out all works fine, but trying to cut the corner and gain restricted access comes up with the message.

thanks!
#2

[eluser]pistolPete[/eluser]
Use this:
Code:
...
$statuscheck = $this->session->userdata('status');
...
#3

[eluser]Nouman6[/eluser]
wow, thanks a lot man! saved me a headache for sure




Theme © iAndrew 2016 - Forum software by © MyBB