Jump to content


archer8

Member Since 12 Jun 2012
Offline Last Active Jun 12 2012 03:08 PM
-----

Topics I've Started

"add record" with session

12 June 2012 - 02:45 PM

Hey There,

I'm actually not even sure if this is my problem (hoping it is though, as it seems to work without the problem mentioned below).

What I'm encountering is "add record" will fail when I include it in a login system that creates a session and then checks the user is logged in.

It will just tend to load forever and do nothing.

	public function __construct() {
		session_start();
		parent::__construct();
		if (!isset($_SESSION['username'])) {
			redirect('admin');
		}
		$this->load->database();
		$this->load->helper('url');
		$this->load->library('grocery_CRUD');
	}

	public function database() {
		$crud = new grocery_CRUD();
		$crud->set_theme('datatables');
		$crud->set_table('table_name');

		$crud->required_fields('lastName');
		$output = $crud->render();
		$this->load->view('database', $output);
	}

If I use the exact same table and function without the session it works fine - I can view and add data.

Any pointers on what I can do to get this working?