Random Password Generator (Rated 0)Description:
This will create a random password, particularly useful for 'lost password' functionality. Code starts here
<?PHP
function makeRandomPassword() {
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$random_password = makeRandomPassword();
echo "Random Password is $random_password";
?>
Submitted by Devscripts on 24-03-2003 16:58 |