https://github.com/lawrence08...
因為覺得這個比較方便、理解,想用這個,結果到了validation就出問題,用到登入介面
public function login() {
//print_r($_POST);
$this->form_validation->set_rules('username', '用户名', 'required');
$this->form_validation->set_rules('password', '密码', 'required');
if ($this->form_validation->run()) {
$username = $this->input->post('username');
$password = $this->input->post('password');
$data['username'] = $username;
$data['password'] = $password;
$user = $this->i2active_user->get_user_by_name($username);
if ($user) {
if ($password == $user->password) {
$this->session->set_userdata('username', $user->name);
redirect('user_list');
} else {
$this->data['login_error'] = '用户名密码错误';
}
} else {
$this->data['login_error'] = '用户不存在';
}
}
$this->load->view('login', $this->data);
}
#去掉$this->form_validation->run()這段就不出問題了
這是為什麼
你們用什麼國際化也可推薦,謝謝