Welcome Guest, Not a member yet? Register   Sign In
Running functions on every page load
#7

[eluser]xtremer360[/eluser]
So your saying I can do something like this. If yes, then since my login controller extends the backend controller then it will run that if statement, correct?

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Backend_Controller extends MY_Controller {

public function __construct()
{
  parent::__construct();
  
  if (isset($this->session->userdata('xtr')) && is_integer($this->session->userdata('user_variable_id')))
  {
   redirect('login');
  }
  else
  {
   redirect('cpanel'};
  }
}
}


Messages In This Thread
Running functions on every page load - by El Forum - 12-07-2012, 03:21 PM
Running functions on every page load - by El Forum - 12-07-2012, 05:13 PM
Running functions on every page load - by El Forum - 12-09-2012, 07:16 AM
Running functions on every page load - by El Forum - 12-09-2012, 07:27 AM
Running functions on every page load - by El Forum - 12-09-2012, 02:19 PM
Running functions on every page load - by El Forum - 12-09-2012, 04:17 PM
Running functions on every page load - by El Forum - 12-09-2012, 04:41 PM
Running functions on every page load - by El Forum - 12-10-2012, 11:54 AM
Running functions on every page load - by El Forum - 12-10-2012, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB