include"master_inc.php";
$username=$_REQUEST['username'];
$password=$_REQUEST['password'];
$password_confirm=$_REQUEST['password_confirm'];
$password_hint = $_REQUEST['password_hint'];
$email=$_REQUEST['email'];
if($password==$password_confirm){
$pw = strip_tags(substr($_POST['password'],0,32));
$cleanpw = md5($pw);
//Debug: echo"New User Defined PW: $cleanpw
email = $email | username = $username
";
$query = "UPDATE `users` SET `password`='$cleanpw', `password_hint`='$password_hint' WHERE `email`='$email'";
// save the info to the database
$results = mysqli_query( $query );
// print out the results
if( $results )
{ echo( "Your changes have been made sucessfully.
Back to Login " );
}
else
{
die( "Trouble saving information to the database: " . mysqli_error() );
}
}
else
{
echo"Your new passwords do not match. Please try again";
}
?>