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

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,

<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">                                      
                           <td>Enter Email: </td>
                               <input type="email" name="user_email" id="email" required>
                           <td><input type = "submit" value="submit" class="button pull-right"></td>
Here is my model:
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) {


       //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'

       //Email content

       $this->email->from('[email protected]', 'Admin');
       $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';


       //Send email

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

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


public function update_password()
    $id = $this->uri->segment(3);
    echo '<script>alert('.$id.')</script>';  

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