View Full Version : Reset Password From

12-25-2011, 08:10 PM
I am a beginner, I created login page. How an email can be sent to the registered email address of a user if he / she forgets the password. I will appreciate your help. Thanks

12-25-2011, 11:19 PM
in php? simplest way would be to make a form to add email address, and then write a script to conpare adresses with address in database and use an if condition to mail the extracted password to that address. Its not exactly beginners stuff though and beyond the ability of the built in wizard

12-26-2011, 03:05 AM
Thanks for your reply, I created the form to get the email, if you can just give me the Php script or tell me where I can find. I would be very thankful.

12-26-2011, 05:02 AM
try hotscripts.com

01-06-2012, 12:05 AM
I have made the form to capture the email and I have the following PHP script on the other page to generate the email but it seems that I am missing something because I am receiving no error but I receive the first message "Your email address is not correct". Can someone pls help me.

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($email, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$email = get_magic_quotes_gpc() ? stripslashes( $email) : $email;

$email = function_exists("mysql_real_escape_string") ? mysql_real_escape_string( $email) : mysql_escape_string( $email);

switch ($theType) {
case "text":
$email = ( $email != "") ? "'" . $email . "'" : "NULL";
case "long":
case "int":
$email = ( $email != "") ? intval( $email) : "NULL";
case "double":
$email = ( $email != "") ? doubleval( $email) : "NULL";
case "date":
$email = ( $email != "") ? "'" . $email . "'" : "NULL";
case "defined":
$email = ( $email != "") ? $theDefinedValue : $theNotDefinedValue;
return $email;
mysql_select_db($database_conniBroker, $conniBroker);
$query_rsPW = "SELECT membership.Email FROM membership WHERE membership.Email = '$email' ";
$rsPW = mysql_query($query_rsPW, $conniBroker) or die(mysql_error());
$row_rsPW = mysql_fetch_assoc($rsPW);
$totalRows_rsPW = mysql_num_rows($rsPW);

$status = "OK";
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
if (!stristr($email,"@") OR !stristr($email,".")) {
$msg="Your email address is not correct<BR>";
$status= "NOTOK";}

echo "<br><br>";
if($status=="OK"){ $query_rsPW="SELECT membership.Email FROM membership WHERE membership.Email = '$email'";
$em=$row->email;// email is stored to a variable
if ($recs == 0) { echo "<center><font face='Verdana' size='2' color=red><b>No Password</b><br> Sorry Your address is not there in our database . You can signup and login to use our site. <BR><BR><a href='Registration.php'> Sign UP </a> </center>"; exit;}

$headers.="Reply-to: $headers4\n";
$headers .= "From: $headers4\n";
$headers .= "Errors-to: $headers4\n";
$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers;// for html mail un-comment this line

if(mail("$em","Your Request for login details","This is in response to your request for login detailst at site_name \n \nLogin ID: $row->userid \n Password: $row->password \n\n Thank You \n \n siteadmin","$headers")){echo "<center><font face='Verdana' size='2' ><b>THANK YOU</b> <br>Your password is posted to your email address . Please check your mail after some time. </center>";}
else{ echo " <center><font face='Verdana' size='2' color=red >There is some system problem in sending login details to your address. Please contact site-admin. <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";}


else {echo "<center><font face='Verdana' size='2' color=red >$msg <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";}