I have this change password kinda page. No matter what they enter the page just seems to refresh itself and display the same for over and over. I get no parse errors on this script.
<?
include('dbinfo.inc.php');
include('functions.inc.php');
if(isset($_POST["submit"])) {
$username = $_GET['username'];
$password = $_POST['password'];
$new1 = $_POST['new1'];
$new2 = $_POST['new2'];
if ($new1 == $new2) {
$password = $new1;
$password = crypt_md5($password, $key);
mysql_query("UPDATE customers SET password='$password' WHERE username='$username'") or die(mysql_error());
echo "<font face='Tahoma' size='2'><b><br><br>Password Updated!</font></b>";
echo "<a href='index.php' target='_parent'> Return Home </a>";
} else {
echo "Error. New passwords do not match each other. <br>";
?> <form>
<input type="button" value="<-Back" onclick="history.back();">
</form>
<?
}
} else {
?>
<form method="post" action="<?=$PHP_SELF?>">
<table width="45%" border="0">
<tr>
<td width="63%"><strong><font size="2" face="Tahoma">Current Password:</font></strong></td>
<td width="37%"><input name="password" type="password" id="password" size="24" maxlength="24"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">New Password:</font></strong></td>
<td><input name="new1" type="password" id="new1" size="24" maxlength="24"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Confirm New:</font></strong></td>
<td><input name="new2" type="password" id="new2" size="24" maxlength="24"></td>
</tr>
<tr>
<td><input type="reset" value="Rest Form"></td>
<td><input type="submit" value="Submit Form"></td>
</tr>
</table>
</form>
<?
}
?>
THANKS!