Random Password generator
Design & Code :: Coding :: PHP & MySQL
Page 1 of 1 • Share •
Random Password generator
This code will generate a random password:
NB The code is not tested so it may have some bugs in it.
- Code:
<?php
//Random password generator by MisterX
//www.designcode.tk
//v1.0
//$len = the length of password
$len="6";
//$cha = chareters used in password
$cha = "ABCDEFGHIJKLMNOPQRSŠZŽTUVXYabcdefghijklmnopqrsšzžtuvxy0123456789";
$i="0";
$pwcha = array();
$cha2 = str_split($cha);
while ($i < $len)
{
array_push($pwcha, array_rand($cha);
$i++;
}
NB! The code is not tested so it may have a few bubs in it!
$password = implode("", $pwcha);
echo "Your new generated password is: ";
echo $password;
?>
NB The code is not tested so it may have some bugs in it.
_________________

"You tried, gave your best, and failed. Here's the lesson: "Never try!""
~Homer Simpson

misterx- Admin

- Posts: 59
Activity: -772
Reputation: 1
Join date: 2009-06-27
Age: 14
Location: Estonia
Re: Random Password generator
so we change the digits by changing the number in this
$len="6";
..?
$len="6";
..?
_________________

Thanks to FusioN for this awesome sig :]

~Fleck- Moderator

- Posts: 274
Activity: -328
Reputation: 8
Join date: 2009-06-28
Age: 16
Location: 127.0.0.1
Re: Random Password generator
jkymmel wrote:Yes but the code i still buggy. It isn't workin' yet.
ok:]
i like vb6 in generating random keys:p
its easy:p and works :]
_________________

Thanks to FusioN for this awesome sig :]

~Fleck- Moderator

- Posts: 274
Activity: -328
Reputation: 8
Join date: 2009-06-28
Age: 16
Location: 127.0.0.1
Re: Random Password generator
hmm for some reason my brain does not like that code
il post my version later 
Permissions of this forum:
You cannot reply to topics in this forum
Home




