Frage

In yii i am creating reset new password functionality. For this purpose user needs to enter his primary email id which he had entered during his registration. After that server will verify this e-mail id and will send security question to him.User will enter answer for that security question.At server side verification of this answer will be done from database. If matching found,password reset link will be get send to that primary email id. So how to implement this functionality in yii framework. Please help me....

War es hilfreich?

Lösung

You implement this thing like this:

  1. Create a password change page, with a text field for submitting email id.
  2. After user submit email, either check via ajax if email exist in database or not, and update the same page, OR, redirect him to same page if email doesnot exist else redirect to another page asking security question, when user submits answer, check whether answer is correct or not, if correct send him the mail with the links of changepassword page.

for checking email is correct or not you can execute following query:

 mysql_query(SELECT email FROM user WHERE email = "$email");

where $email is email submitted by user.

if it returns 1 then email exists, else email doesnot found.

Same can be applied for answer check.

Thanks.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top