Expand|Select|Wrap|Line Numbers
- *9W0C5CB2A08313B8A04E63A80F1E6F01F3LK3876
on my database, I'm currenlty working on a script that changes the admin password and send it for the admin e-mail, but it changes to MD5, I tried to put sha-1, but even so, sha-1 also does not works. The password should begin with a asterisk "*", and it does not when I use SHA-1 or MD5.
The part of the code that does that is this one:
Expand|Select|Wrap|Line Numbers
- //Generate a RANDOM MD5 Hash for a password
- $random_password=md5(uniqid(rand()));
- //Take the first 8 digits and use them as the password we intend to email the user
- $emailpassword=substr($random_password, 0, 8);
- //Encrypt $emailpassword in MD5 format for the database
- $newpassword = md5($emailpassword);
- // Make a safe query update administrator set sPassword = '$newpassword
- $query = sprintf("UPDATE administrator SET sPassword='$newpassword'",
- mysql_real_escape_string($newpassword));
- mysql_query($query)or die('Could not update members: ' . mysql_error());
Thank you