its called learn php and code something yourself.

its called learn php and code something yourself.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
urm thanks but you cant really say that rofl..
even i can fix those errors.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Go for it..
whats the code for the page were you enter the codes.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
PHP Code:<?
include('config.php');
if (!$_POST[submit])
{
?>
<form name="form1" method="post" action="">
<p>Please Enter Your Username and Your Forgot Password Code Below<br>
<br>
Username:
<input type="username" name="textfield">
<br>
<br>
Password Reset Code:
<input name="code" type="password" value="">
<br>
<br>
<input type="submit" name="submit" value="Change My Password">
<br>
</p>
</form>
<?
// The form for recovring password
}else{
?>
<?
$username = $_POST[username];
$passcode = $_POST[code];
$query= MYSQL_QUERY("SELECT * from forgotpw WHERE username = '$username' AND code = '$passcode'");
$exists = MySQL_Fetch_Array($query);
if($exists[code] != $passcode) {
echo(' The Password Reset Code You Entered, Was Incorrect ');
}else{
// checks the code entered was the one in the email
?>
<form name="form2" method="post" action="">
Please Enter A New Password<br>
<br>
New Password:
<input name="pass" type="text" id="pass">
<br>
<br>
Confirm New Password
<input name="pass2" type="text" id="pass2">
<br>
<br>
<input type="submit" name="update value="Change Password">
</form>
}
}
}
// The form where the user can enter a new password
?>
<?
if ($_POST[update])
{
$password = $_POST[pass];
$password2 = $_POST[pass2];
if($password != $password2) {
echo(' Your New Passwords Do Not Match ');
}else{
$password = md5($password);
$password = htmlspecialchars($password);
$query = mysql_query("UPDATE members set password= '$password' WHERE username = '$username' ");
echo(' Your password has been changed ');
// Updates the database with the new password
?>
<?
}
}
}
}
?>
i think you got your if and else backwords.
if($exists[code] != $passcode) so if the code exists your giving them an error message?
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
I dunno? ;s
Want to hide these adverts? Register an account for free!