Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $emaill = $this->input->post('emaill');
- $otp = $this->input->post('otp');
- //$this->form_validation->set_rules('emaill', 'emaill', 'required|min_length[10]|max_length[30]|matches[otp]');
- $this->form_validation->set_rules('otp', 'otp', 'required|min_length[6]|max_length[6]');
- $this->form_validation->set_rules('newpassword', 'newpassword', 'trim|required|max_length[15]|min_length[8]|alpha_numeric|matches[confirmpassword]');
- $this->form_validation->set_rules('confirmpassword', 'Confirm password', 'trim|required');
- if ($this->form_validation->run() == FALSE) {
- $this->load->view('login');
- } else {
- if($this->session->userdata('otp') == "$otp" && $this->session->userdata('findemaill') == "$emaill" ) {
- $user = $this->session->userdata('findemaill');
- $this->load->model('Login_model');
- $result['data'] = $this->Login_model->resetpassword($user);
- $result['data1'] = $this->Login_model->resetpasswordd($user);
- $this->session->set_flashdata('success_msg', 'successfull reset the password');
- $this->load->view('login');
- }
- }
- }
- public function resetpassword($user) {
- $new_password = $this->input->post('newpassword');
- $this->db->set('password',$new_password);
- $this->db->where('email',$user );
- $this->db->update('supplier_registration');
- }
- public function resetpasswordd($user) {
- $new_password = $this->input->post('newpassword');
- $this->db->set('password',$new_password );
- $this->db->where('email',$user);
- $this->db->update('customer_registration');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement