You need to modify the login verification module of my_controller.php and controller user.php as follows:
my_controller.php
Class My_controller extends ci_controller{public function __construct () { parent::__construct (); /* Determine if you are logged in and determine if the current URL is auth/login*/ if (! $this->tank_auth->is_logged_in () && ($this Router->fetch_class ()! = ' Auth ' && $this->router->fetch_method ()! = ' login ') } { $redirect = $ This->uri->uri_string (); if ($_server[' query_string ') { $redirect. = '? '. $_server[' query_string ']; } /* Jump to the user login page, specify login to jump to url*/ redirect (' auth/login?redirect= '. $redirect);}}
user.php
Class User extends My_controller {function login () {if ($this->tank_auth->is_logged_in ()) { Logged in redirect ('/'); } else {//other codes .../* Determine if there is redirect information */$data [' redirect '] = Isset ($_get[' re Direct '])? $_get[' redirect ': '/'; if ($this->form_validation->run ()) {//validation ok if ($this->ta Nk_auth->login ($this->form_validation->set_value (' login '), $this-& Gt;form_validation->set_value (' password '), $this->form_validation->set_value (' Remember '), $data [' Login_by_username '], $data [' Login_by_email ']) { Success Redirect ($data [' redirect ']); } else {//error handling} } $this->load->view ("Login_form")}}
Note: In Login_form, you need to be aware that the form address is submitted:
In Login_form, you need to note that the form address of the submission forms:
http://www.bkjia.com/PHPjc/752347.html www.bkjia.com true http://www.bkjia.com/PHPjc/752347.html techarticle need to modify my_controller.php and Controller login Verification module user.php, code as follows: my_controller.php class My_controller extends ci_controller{ Public Function __construct ...