Forum Moderators: coopster
Now I know substantially more and want to switch it over to a custom script I wrote, but was wondering since I cant test each of the 1700 accounts, what's the best way to convert the passwords from plain text to md5 encryption?
$q = "select * from users";
$r = mysql_query($q);while ($row = mysql_fetch_assoc($r)) {
$q = "update users set password = '" . md5($row['password']) . "' where userid ='$userid'";
}
If you store the passwords in a file it depends alot on how you store them (ie one on each line, comma separated aso)
$q = "select id, password from users";
$r = mysql_query($q);while ($row = mysql_fetch_assoc($r)) {
$q = "update users set password = '" . md5($row['password']) . "' where userid ='" . $row['id'] . "'";
$r2 = mysql_query($q);
}
Best regards
Michal Cibor
PS.THere still will be some time when users won't be able to login: between db change and script change.(You need to modify your validation script to if(md5($_POST["password"]) == $db_password)...