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()这段就不出问题了
这是为什么
你们用什么国际化也可推荐,谢谢