Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. $emaill = $this->input->post('emaill');
  2. $otp = $this->input->post('otp');
  3.  
  4. //$this->form_validation->set_rules('emaill', 'emaill', 'required|min_length[10]|max_length[30]|matches[otp]');
  5. $this->form_validation->set_rules('otp', 'otp', 'required|min_length[6]|max_length[6]');
  6. $this->form_validation->set_rules('newpassword', 'newpassword', 'trim|required|max_length[15]|min_length[8]|alpha_numeric|matches[confirmpassword]');
  7. $this->form_validation->set_rules('confirmpassword', 'Confirm password', 'trim|required');
  8.  
  9. if ($this->form_validation->run() == FALSE) {
  10. $this->load->view('login');
  11. } else {
  12.  
  13.  
  14. if($this->session->userdata('otp') == "$otp" && $this->session->userdata('findemaill') == "$emaill" ) {
  15. $user = $this->session->userdata('findemaill');
  16. $this->load->model('Login_model');
  17. $result['data'] = $this->Login_model->resetpassword($user);
  18.  
  19. $result['data1'] = $this->Login_model->resetpasswordd($user);
  20. $this->session->set_flashdata('success_msg', 'successfull reset the password');
  21. $this->load->view('login');
  22.  
  23. }
  24.  
  25.  
  26. }
  27.  
  28. }
  29.  
  30. public function resetpassword($user) {
  31.  
  32.  
  33. $new_password = $this->input->post('newpassword');
  34. $this->db->set('password',$new_password);
  35. $this->db->where('email',$user );
  36. $this->db->update('supplier_registration');
  37. }
  38. public function resetpasswordd($user) {
  39. $new_password = $this->input->post('newpassword');
  40. $this->db->set('password',$new_password );
  41. $this->db->where('email',$user);
  42. $this->db->update('customer_registration');
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement