我有一個重置密碼功能。我想知道成功重置密碼后如何將用戶重定向到登錄頁面。這是我的代碼。public function UpdatePassword(){ $tok = $_SESSION['token']; $newpass = md5($this->security->xss_clean($this->input- >post('newpass'))); $confpass = md5($this->security->xss_clean($this->input- >post('confpass'))); if($newpass == $confpass){ $this->db->where('password', $tok); $this->db->update('user', array('password' => $confpass)); if($this->db->affected_rows() > 0){ return true; }else{ return false; } } else{ $this->session->set_flashdata('error_submit', 'new and conf does not match'); redirect(base_url('Login/resetpassword')); } //redirect(base_url('Login/Login')); }
- 2 回答
- 0 關注
- 118 瀏覽
添加回答
舉報
0/150
提交
取消