Advertisement
roniewill

Idex Funtion

Sep 23rd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. public function index()
  2.     {
  3.         $this->form_validation->set_rules('login_email', 'E-MAIL',
  4.             'required|trim');
  5.         $this->form_validation->set_rules('login_senha', 'SENHA',
  6.             'required|trim');
  7.  
  8.         if ($this->form_validation->run() == TRUE) {
  9.  
  10.             $identity = $this->input->post('login_email');
  11.             $password = $this->input->post('login_senha');
  12.             $remember = TRUE; // remember the user
  13.  
  14.             if ($this->ion_auth->login($identity, $password, $remember)) {
  15.                 redirect('admin', 'refresh');
  16.             } else {
  17.                 set_msg('msgerro', 'Dados incorretos! Tente novamente.', 'erro');
  18.                 redirect('login', 'refresh');
  19.             }
  20.         } else {
  21.  
  22.             $this->load->view('includes/head');
  23.             $this->load->view('login');
  24.             $this->load->view('includes/footer');
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement