Guest User

Untitled

a guest
Sep 12th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1.  public function login() {
  2.         $this->form_validation->set_rules($this->login_rules);
  3.         if($this->form_validation->run()) {
  4.             $username = $this->input->post('username');
  5.             $password = $this->input->post('password');
  6.            
  7.             if(!$this->autentifikasi->login($username,$password)) {
  8.                 $this->session->set_flashdata('pesan', '<div class="error">Login gagal</div>');
  9.                 redirect(site_url('user/login'));
  10.             } else {
  11.                 $this->session->set_flashdata('pesan', '<div class="sukses">Anda telah berhasil login, selamat berbelanja.</div>');
  12.                 redirect(site_url('user/login'));
  13.             }
  14.         }
Add Comment
Please, Sign In to add comment