Problem in a generate password function
- From: gamito@xxxxxxxxx ("Mário Gamito")
- Date: Mon, 31 Mar 2008 09:57:04 +0100
Hi,
I have the code of a function to generate a random 10 character long
password following my signature.
To test it i do:
$clearpass = create_pass();
print('Clear: ' . $clearpass);
die();
But the output is only "Clear:"
Why isn't it working ?
Any help would be appreciated.
Warm Regards,
Mário Gamito
--
function create_pass ()
{
$length=10;
$password = "";
$possible = "0123456789abcdefghijklmnopqrstuvxz";
$i = 0;
while ($i < $length) {
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
if (!strstr($password, $char)) {
$password .= $char;
$i++;
}
}
return $password;
}
.
- Follow-Ups:
- Re: [PHP] Problem in a generate password function
- From: Jim Lucas
- Re: [PHP] Problem in a generate password function
- From: Stut
- Re: [PHP] Problem in a generate password function
- Prev by Date: Re: [PHP] restricting filesystem access
- Next by Date: Re: [PHP] Problem in a generate password function
- Previous by thread: restricting filesystem access
- Next by thread: Re: [PHP] Problem in a generate password function
- Index(es):
Relevant Pages
|