Jump to content

email forgot password option


stuart7398

Recommended Posts

You could help everyone by posting your script, otherwise we can only offer suggestions like,

 

1. querying the database to find a record matching the username and email

2. send an email to verify the password change which contains a GET link

3. upon verification from GET link, create a random password

4. find the record again and update it with new random password

5. email the random password

 

:)

Link to comment
Share on other sites


<?
$con=mysql_connect("localhost","root","");

mysql_select_db("dbname",$con);
if($_POST["submit"]=='submit')
{
$name=$_POST["forgetpass"];

$sql=mysql_query("select name from tablename where email like '$name' or username like '$name'");
while($res=mysql_fetch_array($sql))
{
echo $res["name"];
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form action="" method="post">
<input type="text" name="forgetpass" value="" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>


Link to comment
Share on other sites

Allow the user to enter the userid/username and after clicking some buttons then do:

    -verify the user entered id or name

    -if correct mail the randomly generated new passoword to the email address(stored in db during registration) else generate some error message.

Link to comment
Share on other sites

What you want to do is, have a form where the person needs to enter a username/email. AFter process the form and generate a 8 digit password. Send an email with a new password, and update the mysql database with the new password. Easy as that :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.