i coded the forgot password script and want to share it. and it works perfectly for me.
make a file called forgot.php and put the coding below inside it
make a file called forgot.php and put the coding below inside it
PHP Code:
<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");
$bcon = connectdb();
include("forgot2.php");
$a = $_GET["a"];
$em = $_POST["em"];
$username = $_POST["username"];
if($a=="s"){
echo "<card id=\"log\" title=\"Forgot Password\">\n";
echo "<p align=\"center\">";
if($em==""){
echo "$error1<br/>";
echo "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
}//else if($nick==""){
//echo "$error2<br/>";
//echo "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
//}
else{
$pwd = mysql_fetch_array(mysql_query("SELECT pwd FROM ibwf_users WHERE name='".$username."'"));
$message = "This email is a password reminder.
Your username is: $username
Your password is: $pwd[0]
Login at: http://forum.htportal.net/login.php?loguid=$username&logpwd=$pwd[0]
";
$to = "$em";
$subject = "HTPortal.net Password";
$txt = "$message";
$headers = "From: no-reply@htportal.net";
mail($to,$subject,$txt,$headers);
echo "Password Sent!<br/>Username: $username<br/> Sent To: $em<br/>";
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
}
echo "</p>";
echo "</card>";
}else{
echo "<card id=\"log\" title=\"HT Portal Password Sender\">\n";
echo "<p align=\"center\">";
echo "<img src=\"$image\" alt=\"*\"/><br/>";
echo "$admin<br/><br/>";
echo "Your Username:<br/>";
echo "<input type=\"username\" name=\"username\" value=\"\" maxlength=\"20\"/><br/>";
echo "Your Email:<br/>";
echo "<input type=\"em\" name=\"em\" maxlength=\"50\"/><br/>";
echo "<anchor>Send password<go href=\"forgot.php?a=s\" method=\"post\">";
echo "<postfield name=\"username\" value=\"$(username)\"/>";
echo "<postfield name=\"em\" value=\"$(em)\"/></go></anchor><br/>";
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "</card>";
}
?>
</wml>
Comment