code showing message
Posted: Sun Feb 26, 2012 2:59 am
hi
i was wondering if anyone had any idea how to fix the error in my code? the problem im having is this message is showing before i do anything on my page (Old password incorrect. please try again.) but other then that the code is work thanks...
i was wondering if anyone had any idea how to fix the error in my code? the problem im having is this message is showing before i do anything on my page (Old password incorrect. please try again.) but other then that the code is work thanks...
Code: Select all
<?PHP
$reqlevel = 1;
include("membersonly.inc.php");
if ($allowChangePassword == false){die($disabledFeatures);}
$oldpass1 = hash('sha512', $_POST['oldpass']);
$password1 = hash('sha512', $_POST['password']);
$password2 = hash('sha512', $_POST['password2']);
if ($password1 == $password2 && $password1 <> ""){
$query = "Select * from ".$DBprefix."signup where username='$user_currently_loged' And password='$oldpass1'";
$result = mysql_query($query);
if ($row = mysql_fetch_array($result)){
$query = "UPDATE ".$DBprefix."signup Set password = '$password1' where username='$user_currently_loged'";
$result = mysql_query($query);
$_SESSION["pass"] = $password1;
makeform("You password was changed.");
}else{
makeform("Old password incorrect. please try again.");
}
}else{
if ($password1 == ""){makeform("");}
else{makeform("Your password do not match try again.");}
}
function makeform($errormessage){
?>Code: Select all
<?PHP echo "<font color=\"#FF0000\"><strong>$errormessage</strong></font>";?>