php - pass parameters in URL code igniter -
i new ci , try pass information login page following...
public function authenticate() { $this->load->model('user_model', '', true); if ($this->user_model->authenticate($this->input->post('username'), $this->input->post('password'))) { $this->session->set_userdata('loggedin', true); header('location: /'); } else { header('location: /sessions/login/error?='.'1'); } }
and on login page use _get.
so how best go in codeigniter?
first of all, using sensitive data email/password general no-no. bad practice way.
but answer question here - http://www.codeigniter.com/userguide3/libraries/input.html
$this->input->get('username')
equal $_get['username']
. might use $this->input->get('username', true)
escape malicious code.
and $this->input->post('username')
equal $_post['username']
. advise use (it requires modification of html though)
Comments
Post a Comment