hello,
After i logged successfully into the system as an admin, i would like to change my(admin) password sometime.
when i click on a button to change the admin password, it prompts for old password, new password and re-typing the newpassword: If both the new passowrd and the re-entered is same, it has to update.I am able to compare the both.But, i also want to check my oldpassword, i.e with the password which i logged in!
so, all i want is, when i would like to change the password,
Old password should match with that of the one in the db and
the new passwords which are entered twice should be entered same.
If any of these conditions fail, an error mesg should be prompted!
I used md5 to save my old password.
I hope somebody would help me.
thanks in advance
somehow, i'm upto here now:
<?
include "dbconnection.ini";
if ($newpassword <>$newpassword2){
echo "passwords do not match. please re-enter passwords!";
echo "<html><body>
echo("<form action=\"$PHP_SELF\" method=\"POST\">\n");
echo("Old password:<input type=\"password\" name=\"oldpassword\" value=\"$oldpassword\"><br><br>
New password:<input type=\"password\" name=\"newpassword\"><br>
Repeat new pasword:<input type=\"password\" name=\"newpassword2\"><br>
<input type=\"hidden\" value=\"$userid\">
<input type=\"submit\" value=\"submit\"></form></body></html>");
}else{
$sql="update TBL_USER set USER_PASSWORD=MD5($password) where USER_ID =$userid";
$result=ibase_query($sql);
if (!$result){
echo "Change update did not take place. Please retry";
}else {
echo "change successful!";
}
}
?>