I'm creating a site where there is a member login. I am using the following script to create a random encrypted password.
function makeRandomPassword() {
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$random_password = makeRandomPassword();
$db_password=md5($random_password);
How can I make it so that the members can change their own password to something else after they made their initial login with the random password?