Masoud Tavakkoli Masoud Tavakkoli - 1 year ago 82
PHP Question

hooks didn't load in codeigniter

I'm new in codeigniter, I want 2 page with the name of "login" and "admin"
i use hook and session to detect user is logged in or not, but unfortunately hook didn't load (Call) at all.
any idea?

My controller :

defined('BASEPATH') OR exit('No direct script access allowed');

class Auth extends CI_Controller{

public function __construct(){

public function index(){


My hook :

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

class Auth_hook {

protected $CI;

public function __construct() {
$this->CI =& get_instance();

public function index(){

EDIT: And finally


Answer Source

Try this :


Instead of this :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download