|
现在数据库插入帐号密码,然后界面登录,验证成功后就跳转页面,可是代码不知道哪来错了
控制器:
public function login_info_view()
{
$this->load->model('information_model');
$user = $this->db->get('user');
$data['user'] = $this->information_model->get_user();
$login_account = $this->input->post('account');
$login_password = $this->input->post('password');//输入的帐密
$this->form_validation->set_rules('Account', 'Account', 'required');
$this->form_validation->set_rules('Password', 'Password', 'required');
if ($this->input->post()==NULL)
{
$this->load->view('information/login_info_view',$data);
}
else
{ if($this->form_validation->run())
{
$this->load->view('information/Success');
}
else $this->load->view('information/Fail');
}
}
模型
public function get_user()
{
$all_user = $this->db->get('user');
$data = array(
'account' => $this->input->post('account'),
'password'=>$this->input->post('password'),
);
$sql = $this->db->query("select * from user WHERE account = 'account' AND password = 'password'");
return $all_user->result_array();
}
有大神可以帮我改一下吗。。 |
|