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

 

:)


<?
$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>


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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.