I'll see if I can make this question clear enough to be answerable:
I have a users db that I have to import a spreadsheet of a couple hundred existing clients into. The problem is that I need to generate a random password for each one of them.
For new users signing up for the first time I use:
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();
which works quite well.
Does anyone know of a way that I could do something similar in a batch process? Or do I have to do all 200 users one at a time?
TIA