Problem in a generate password function



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;

}
.



Relevant Pages

  • Re: [PHP] Problem in a generate password function
    ... I have the code of a function to generate a random 10 character long ... password following my signature. ... $clearpass = create_pass; ... "Some men are born to greatness, some achieve greatness, ...
    (php.general)
  • Re: People posting codes
    ... ie. it interprets blank liens as NUL character 0x00). ... are generated from SHA-1 hashes of user passwords. ... clearing the upper two bits so it's less than q (which has it's upper ... Notice that the signature of this message has two lines. ...
    (sci.crypt)
  • Re: What did you expect at lvl 60 ?
    ... when a new account is created from an old ... the new character should already have the three minor talents ... give mastery in that area. ... Similarly, at 60, players tend to have signature moves or sequences. ...
    (alt.games.warcraft)
  • -Crawl- -Stone Soup- Suggested new Crawl keycommands screen
    ... Dungeon Interaction and Information: Player Character Information: ... eat food ... A good signature is a concise and original summary of personality. ...
    (rec.games.roguelike.misc)
  • Re: Carb confusion
    ... >> you see this character below: ... Only your signature. ... even though the microsoft software does it by default. ... President, or that we are to stand by the President ...
    (alt.support.diabetes)