Welcome Guest, Not a member yet? Register   Sign In
Helpers nor the session class won't initiate... what am I doing wrong?
#1

[eluser]darren884[/eluser]
Here is my code:
Code:
<?php

class Admin extends Controller {

    function __construct() {
        $this->load->library('session');
        $this->load->helper('url');
        parent::Controller();
    }
    
    function index() {
        print_r($this->session);
        exit();
        if ( isset($this->session->userdata('logged_in')) && $this->session->userdata('level') == 'admin') {
        } else {
            redirect('login.html');
        }
    }
}

I am using PHP5 so it's not the __construct... I am new to code igniter... what am I doing wrong here?
#2

[eluser]wiredesignz[/eluser]
Try calling the parent::Controller() constructor before you load your library/helper.
#3

[eluser]darren884[/eluser]
Tried doesn't work, object is not initiated
#4

[eluser]darren884[/eluser]
My bad it was my host I forgot I had to turn on PHP5




Theme © iAndrew 2016 - Forum software by © MyBB