Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not so sure where you are stuck at. I can get the fact that you are creating a temporary flag for a user which you verify when the user clicks the link. So, that means, you can start with a session at that point, and the user can only reset the password, only if that particular session is active.</p> <p>After this step, you ask the user to input his new password, and since you have the temporary flag which you call as <code>$temp_pass</code> for the user (please take care that it should be unique), then you can get the user who is trying to reset the password.</p> <p>So, all you need to do is to run a db query of this kind -</p> <pre><code>$this-&gt;db-&gt;where('reset_pass', $temp_pass); $this-&gt;db-&gt;update('users', $data); // where $data will have the fields with values you are updating </code></pre> <hr> <h2>I guess you made an error</h2> <p>Also, I just noticed in your <code>recover_password()</code> function -</p> <pre><code>$message .= "&lt;p&gt;&lt;a href='".base_url()."main/reset_password/$temp_pass'&gt;Click here &lt;/a&gt;if you want to reset your password, if not, then ignore&lt;/p&gt;"; </code></pre> <p>Shouldn't the above line be -</p> <pre><code>$message .= "&lt;p&gt;&lt;a href='".base_url()."main/reset_password/".$temp_pass."'&gt;Click here &lt;/a&gt;if you want to reset your password, if not, then ignore&lt;/p&gt;"; </code></pre> <h2>Update</h2> <p>You can pass <code>$temp_pass</code> into the sessions and retrieve from there. That's one way to go about it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload