Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function process_login()
- {
- $this->form_validation->set_rules('username', 'Username', 'required');
- $this->form_validation->set_rules('password', 'Password', 'required');
- if ($this->form_validation->run() == TRUE)
- {
- $username = $this->input->post('username');
- $password = $this->input->post('password');
- if ($this->Login_model->check_user($username, $password) == TRUE)
- {
- $data = array('username' => $username, 'login' => TRUE);
- $this->session->set_userdata($data);
- redirect('absen');
- }
- else
- {
- $this->session->set_flashdata('message', 'Maaf, username dan atau password Anda salah');
- redirect('login/index');
- }
- }
- else
- {
- $this->load->view('login/login_view');
- }
- }
Add Comment
Please, Sign In to add comment