public function login_validate(){
$username= $this->input->post('username');
$password= $this->input->post('password');
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[4]|max_length[32]');
$this->form_validation->set_rules('password', 'Password', 'trim|required');
if ($this->form_validation->run()){
if ($username == "admin" && $password == "123"){
redirect('Checkout');
} else {
$data['error_info'] = "密码或账号错误!";
$this->load->view('login', $data);
}
} else {
$data['error_info'] = "密码或账号错误!";
$this->load->view('login', $data);
}
}