Welcome Guest, Not a member yet? Register   Sign In
How to SEND LINK in email in codeigniter and how to GET id selected user
#1

Hello guyz i have create small kind of application in codeigniter,in this application i am doing forgot password module, i have created a function of forgot passowrd and send link in email But did not get id in link so how to set id in link, i want id in link and ecrypted pass in method, I need encrypted URL pass in update password view,


Code:
<form id="resetPassword" name="resetPassword" method="POST" action="<?php echo base_url(); ?>welcome/ForgotPassword" onsubmit ='return validate()'>
               <table class="table table-bordered table-hover table-striped">                                      
                   <tbody>
                       <tr>
                           <td>Enter Email: </td>
                           <td>
                               <input type="email" name="user_email" id="email" required>
                           </td>
                       <tr>
                           <td></td>
                           <td><input type = "submit" value="submit" class="button pull-right"></td>
                       </tr>
                   </tbody>    
               </table>
           </form>
Here is my model:
Code:
public function sendpassword($data) {
   $user_email = $data['user_email'];

   $query1 = $this->db->query("SELECT * from user_registration where user_email='" . $user_email . "'");
   $row = $query1->result_array();

   if ($query1->num_rows() > 0) {

       $this->load->library('email');

       //SMTP & mail configuration
       $config = array(
           'protocol' => 'smtp',
           'mailpath' => 'C:\xampp\sendmail',
           'smtp_host' => 'ssl://smtp.googlemail.com',
           'smtp_port' => 465,
           'smtp_user' => '[email protected]',
           'smtp_pass' => 'XXXXXXX',
           'mailtype' => 'html',
           'charset' => 'utf-8'
       );
       $this->email->initialize($config);
       $this->email->set_mailtype("html");
       $this->email->set_newline("\r\n");

       //Email content

       $this->email->from('[email protected]', 'Admin');
       $this->email->to($user_email);
       $this->email->subject('Password reset request');
       $mail_message = 'Dear ' . $row[0]['full_name'] . ',' . "<br>\r\n";
       $mail_message .= 'Thanks for contacting regarding to forgot password,<br> Click On Link And Reset Password:<b><a href="http://www.ciadmin.local/welcome/update_password">Reset Password</a></b>'."\r\n";
       $mail_message .= '<br>Please Update your password.';
       $mail_message .= '<br>Thanks & Regards';
       $mail_message .= '<br>Red Feather Software';

       $this->email->message($mail_message);

       //Send email

       if ($this->email->send()) {

           echo '<script>alert("success..!")</script>';
       } else {
           echo '<script>alert("Please Try Again Later..!")</script>';

       }
   }
}

Controller:
Code:
public function update_password()
{
  $this->load->model("main_model");
    $id = $this->uri->segment(3);
    echo '<script>alert('.$id.')</script>';  
    $this->load->view('update_password');
}
Reply


Messages In This Thread
How to SEND LINK in email in codeigniter and how to GET id selected user - by jaydevvara - 08-18-2018, 04:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB