php - pass a post value from view to controller to model, and back to controller in code igniter -
i'm creating login form codeigniter, , have controller collects inputs form, want check make sure user entered in database, i'm collecting values in post , want send them model database connection. if results in database want send controller yes or no , can go there. i'm kind of stuck, have far:
the controller:
function do_login() { $login = $this->input->post('login'); $pwd = md5($this->input->post('passwd')); }
the model:
function check_login() { $sql = $this->db->query("select * members loin = '?' , password = '?'", array(//post stuff goes in here)); return $sql->result(); }
i'm not sure how pass data model, , controller.
any great! thanks!
in mvc form post sending controller (in action property in form) , controller (as name decribed) controls happend, in case should ask database verification via model, response, decide do, , use view display results...
so in controller:
function do_login() { $login = $this->input->post('login'); $pwd = md5($this->input->post('passwd')); $results = $this->...your_model_name...->chek_login( parameters login , password ) // base on results: has records or has not - // maybe display view }
Comments
Post a Comment