Random Password generator

View previous topic View next topic Go down

Random Password generator

Post  misterx on Sat Jul 11, 2009 10:25 am

This code will generate a random password:
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
Admin

Posts: 59
Activity: -772
Reputation: 1
Join date: 2009-06-27
Age: 14
Location: Estonia

Back to top Go down

Re: Random Password generator

Post  ~Fleck on Sat Jul 11, 2009 11:47 am

so we change the digits by changing the number in this
$len="6";
..?

_________________

Thanks to FusioN for this awesome sig :]

~Fleck
Moderator
Moderator

Posts: 274
Activity: -328
Reputation: 8
Join date: 2009-06-28
Age: 16
Location: 127.0.0.1

Back to top Go down

Re: Random Password generator

Post  jkymmel on Sat Jul 11, 2009 12:31 pm

Yes but the code i still buggy. It isn't workin' yet.

_________________

JKymmelDisain::WebDesign

jkymmel
Admin
Admin

Posts: 76
Activity: -709
Reputation: 3
Join date: 2009-06-27
Age: 14
Location: Estonia

http://jkymmel.tk

Back to top Go down

Re: Random Password generator

Post  ~Fleck on Sat Jul 11, 2009 12:47 pm

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
Moderator

Posts: 274
Activity: -328
Reputation: 8
Join date: 2009-06-28
Age: 16
Location: 127.0.0.1

Back to top Go down

Re: Random Password generator

Post  gangster136 on Sat Jul 11, 2009 2:45 pm

hmm for some reason my brain does not like that code Smile il post my version later Wink

gangster136
Moderator
Moderator

Posts: 27
Activity: -815
Reputation: 1
Join date: 2009-06-28
Age: 17
Location: United Kingdom

http://www.tubeboost.tk

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum