I coded my own simple forgot password script.Everythings fine and working except the password because the password send to the user's mail is encrypted.How can i decrypt that password so that the password send to the user email address will be the true pw and not encrypted..
I fetch the password from ibwf_users pass row thats why it is md5 encrypted..
Please guys help me to fix this stuffs,
Heres the code of my forgot password script...
I fetch the password from ibwf_users pass row thats why it is md5 encrypted..
Please guys help me to fix this stuffs,
Heres the code of my forgot password script...
PHP Code:
<?php
/*
PINOYGSM 2010 SCRIPT
BY WYVERN AKA L0RDRAYVEN
WYVERNSPACE@GMAIL.COM
(dont removed this copyrights)
*/
include("core.php");
include("config.php");
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<html>";
echo "<head>";
echo "<title>Forgot Password</title>";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"mobile interactive community that can be access wherever you are in the world. It is made to connect people and to establish unity with tones of new exciting features like Scrembox, Forums, Articles, Chatrooms, Downloads, Clubs, Photo Gallery, Blogs, Polls, Chappel, Rpg Game, Lucky9, Jack En Poy, Spin The Wheel, Virtual Pets, Wap Jueteng And More Options That Entertain You And Makes You Busy\"/>
<meta name=\"keywords\" content=\"pinoygsm, wyvern, l0rdrayven, free, community, forums, chat, wap, communicate, free sms, mp3, scandals, videos, games, downloads, scripts, ringtones, porn, xxx, hot, new, latest\"/>
<link rel=\"shortcut icon\" href=\"fav.ico\" type=\"image/x-icon\"/>
<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\"/>";
echo "</head>";
echo "<body>";
$bcon = connectdb();
if (!$bcon)
{
echo "<div align=\"center\"><div class=\"t2\">Error.!</div><br/>";
echo "Sorry Probably Our Database Cant Hold The System Of Our Server.<br/>";
echo "Please Come Back Later<br/><br/>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
exit();
}
$do = $_GET["do"];
if($do=="")
{
echo "<div align=\"center\">";
echo "<div class=\"head\">Password Retrieval</div><br/>";
include("ads.php");
echo "<br/>";
echo "Please type your registered screename to retrieve your password.";
echo "<hr/>";
echo "<form action=\"forgotpw.php?do=get\" method=\"post\">";
echo "Screename:<br/><input type=\"text\" name=\"nick\" maxlength=\"15\"/><br/>";
$text = rand(11111,99999);
echo "Verification Code:<br/>";
echo "<img src=\"captcha.php?text=$text\" alt=\"verify\"/> ";
echo "<input type=\"text\" format=\"*n\" name=\"ucans\" maxlength=\"5\" size=\"5\"/><br/>";
echo "<input type=\"hidden\" name=\"rcans\" value=\"$text\"/>";
echo "<input type=\"submit\" value=\"Submit\"/>";
echo "</form>";
echo "<br/>";
echo "<a href=\"terms.php\">Register</a> <a href=\"index.php\">";
echo "Home</a>";
echo "<div class=\"foot\">$mysite</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
}
//////////////////////Get Password
if($do=="get")
{
$nick = $_POST["nick"];
$ucans = $_POST["ucans"];
$rcans = $_POST["rcans"];
$uid = getuid_nick($nick);
echo "<div align=\"center\">";
echo "<div class=\"head\">Password Retrieval</div><br/>";
include("ads.php");
echo "<br/>";
if(checkuname($uid)=="1")
{
echo "Username Doesnt Exist";
}else if($ucans!=$rcans)
{
echo "Image Verification Is Incorrect";
}else{
$gpw = mysql_fetch_array(mysql_query("SELECT email, pass FROM ibwf_users WHERE id='".$uid."'"));
$pwd = $gpw[1];
$email = $gpw[0];
if($gpw)
{
$msg = "\n Username: ".$nick." \n Password: ".$pwd." \n\n Please Keep Your Password Safe! \n\n Dont distribute your login informations to anyone. \n Please ignore this mail if you recieve this without asking your password retrieval. \n\n Follow the link below to login into your account directly \n http://pinoygsm.net/in.php?u=".$nick."&p=".$pwd." \n\n Thank You, \n PinoyGsm.Net";
$subj = "Pinoygsm Password Retrieval";
$headers = 'From: noreply@pinoygsm.net' . "\r\n" .
'Reply-To: wyvernspace@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email, $subj, $msg, $headers);
echo "Password sent successfully to $nick's registed email.";
}else{
echo "Database Error.!";
}
}
echo "<br/><br/>";
echo "<a href=\"forgotpw.php\">Back</a> <a href=\"terms.php\">Register</a> <a href=\"index.php\">";
echo "Home</a>";
echo "<div class=\"foot\">Pinoygsm</div>";
echo "<br/>Page Took ";
$load = microtime();
print (number_format($load,2));
echo " Seconds";
echo "</div>";
echo "</body>";
}
exit();
?>
</html>
Comment