Successo!
if(isset($_POST['submit']))
{
$account = $_POST['account'];
$passwordOld = $_POST['passwordOld'];
$passwordNew = $_POST['passwordNew'];
$passwordNew1 = $_POST['passwordNew1'];
$passwordolde = sha1(strtoupper($account) . ":" . strtoupper($passwordOld));
$passwordnewe = sha1(strtoupper($account) . ":" . strtoupper($passwordNew));
$passwordNew1e = sha1(strtoupper($account) . ":" . strtoupper($passwordNew1));
$account = ($account);
$eoldpass = strtoupper($passwordolde);
$enewpass = strtoupper($passwordnewe);
$enewpass1 = strtoupper($passwordNew1e);
$con = mysql_connect("$mlch", "$mlcu", "$mlcp") or die(mysql_error());
mysql_select_db("$cpd", $con) or die(mysql_error());
$query = "SELECT id FROM account WHERE username = '".$account."' AND sha_pass_hash = '".$eoldpass."'";
$result = mysql_query($query) or die(mysql_error());
$numrows = mysql_num_rows($result);
echo "
";
if($enewpass != $enewpass1) { die("As senhas novas não são iguais!"); } if($numrows == 0) { die("Nome da conta ou senha é inválida!"); }
$query = "UPDATE account SET sha_pass_hash = '".$enewpass."' WHERE username = '".$account."'"; $result = mysql_query($query) or die(mysql_error());
echo ""; echo " "; echo " "; echo "A senha da conta '".$account."' foi alterada com sucesso! ";
echo " |
";
mysql_close($con);
}
?>