Welcome Guest, Not a member yet? Register   Sign In
problem to session
#1

[eluser]SaSa[/eluser]
Hi
I started a session with this load:
Code:
$this->load->library('session');

now if I want it used to take matching other pages. What is it?
my code:
Code:
function admin_login_successful(){
        //isert to $
        $useradmin = $this->input->post('useradmin', TRUE);
        $passadmin = $this->input->post('passadmin', TRUE);
        //convert to hash
        $passworddx = md5($passadmin);
        //array for where
        $where = array('useradmin' => $useradmin, 'passadmin' => $passworddx);
        //select and weher
        $q = $this->db->get_where('login', $where);
        $name = $q->row()->useradmin;
        //insert to session user admin
        $this->session->userdata('useradmin', $name);
        //if suss go to indexadmin
        $data['welcome'] = "welcome $name";        
        $this->load->view('managing-director-zig/indexadmin', $data);
    }
#2

[eluser]oppenheimer[/eluser]
The command to add session data is:
$this->session->set_userdata

Your comment indicates insert but you are actually performing a lookup.




Theme © iAndrew 2016 - Forum software by © MyBB