function login_proses() {
$username = $this->input->post('username');
$password = $this->input->post('password');
$chek = $this->db->get_where('tabel_users', array('username' => $username, 'password' => $password, 'status' => '1'));
$chek2 = $this->db->get_where('tabel_users', array('username' => $username, 'password' => $password, 'status' => '0'));
if ($chek->num_rows() > 0 ) {
$this->session->set_userdata(array('username' => $username, 'status_login_admin' => 'sudah_login'));
redirect('admin/home');
}
else if ($chek2->num_rows() > 0 ) {
$this->session->set_userdata(array('username' => $username, 'status_login_sekda' => 'sudah_login'));
redirect('admin/home_sekda');
}
else {
$this->template->load('templatelogin','admin/login/login_error');
}
}
当我运行该代码并插入chek2的用户名和密码时,我无法访问chek2及其返回登录表单
如何使代码工作,以便我可以访问home_sekda