Quote:
Originally Posted by phplabs
hi,
first, in your query:
$results = mysql_query("SELECT Fieldname FROM tablename WHERE username='$username'")...
did you really name that column 'Fieldname'? i see that later in the code you have a field named 'password'.
second,
if ($oldpass == $q1){
when you have $q1 = mysql_fetch_array($results); in your code, $q1 is not a string but an array. so you should compare it something like $oldpass == $q1['password'].
use functions print_r() and var_dump() to print the variables to screen - this way you'll see what values they *actually* have, because oftentimes the errors occur when the variables have different values (or even different types of values) from what is expected.
|
Thanks for your reply....
I added the print_r($q1) right after the query and lines to compare the old password to what the password is in the database. with the following:
and it is coming back the following:
Array ( [0] => e10adc3949ba59abbe56e057f20f883e [password] => e10adc3949ba59abbe56e057f20f883e )
array
0 => string 'e10adc3949ba59abbe56e057f20f883e' (length=32)
'password' => string 'e10adc3949ba59abbe56e057f20f883e' (length=32)
Thanks
Your password changed successfully. Please keep changing your password for better security
So I am not sure why it is allowing the password to be changed since I am putting in a different password than what is in the database.
Is it possible since the password is in MD5 on the db that it can not be pulled and has to be converted from MD5 to plain text to compare? If so, how?