Location: PHPKode > projects > PHPFreeNews > phpfn/RewritePassword.php
<?php

/*	+--------------------------------------------------------------
	| PHPFreeNews - News Headlines on your website                |
	| Developed by Jim Willsher.                                  |
	| http://www.phpfreenews.co.uk                                |
	+-------------------------------------------------------------+
*/

require_once('Config/Config.php');

$Updated=false;
$Message="";

// Updated details have been submitted?
if (isset($_POST['submit']))
{
	if ($dbuser == trim($_POST['Username']))
	{
		$ok = mysql_query("UPDATE news_users SET Password=MD5('$dbpass'), MustChangePassword=1 WHERE ID='1'");
		if ($ok)
			$Updated = true;
	}
	else
		$Message="Incorrect Credentials";
}
?>

<html>
	<body>
		<?php
		if ($Updated)
		{
			?>
			<p>Username updated successfully.</p>
			<?php
		}
		else
		{
			?>
			<p><?=$Message?></p><br />
			<form action="<?=$_SERVER['PHPSELF']?>" method="post">
				Username: <input type="text" name="Username" size="20" maxlength="20" />
				<input type="submit" name="submit" value="Update" />
			</form>
			<?php
		}
		?>
	</body>
</html>
Return current item: PHPFreeNews