Simple PHP Password Generator

This is a simple password generator written in PHP. Using MD5 random hexadecimals this is will produce strong password, and we also can define how length the password character.

<?php
// using md5 random
// $length = 8 can be change, its length of password character
function md5_pass($length = 8)
{
return substr(md5(rand().rand()), 0, $length);
}
?>

<b>Your Random Password:</b><br />
<?php
    echo md5_pass();
?>
<br />
<form method="post">
<input type="button" value="Generated"
onclick="window.location.reload()">
</form>


Download Source
See in action:

http://kecoa.net/generators/password


Related posts:

  1. Twitter Cant Login Or Reset Password
  2. How To Insert HTML, Javascript, PHP Code Into Joomla 1.5 Administrator Page
  3. Hello world!


Share To Facebook | Tweet This


 
  • http://vekseid.com Forum Design

    Alternately, you can use the dechex function

    $random = ”; for ($i = 0, $i < $length; $i++) { $random .= dechex (mt_rand(0,15)); }
    return $random;

  • http://platerack101.com plate rack

    very cool code, i will try it on one of my web sites, thanks for share.

  • http://www.serialkeygencrack.org SERi

    as well helped to create the registration on its website, works great!

  • http://edinburghdrivingschool.net/ Edinburgh Driving School

    But this is only a pseudo-random generator.

  • http://edinburghdrivingschool.net/ Edinburgh Driving School

    But it is still very useful and not easy to crack a password like that.

  • http://www.henweekends.net/ hen dos

    Is PHP set up to send emails from your server? I use PHPMailer to send emails and it works fine.

  • http://www.henweekends.net/ hen dos

    i created a lil password generator to add to my site, to make it easy for lazy people like be quickly copy and paste a decent password, would it be a good idea to use such a feature on my site..

  • http://www.henweekends.net/ hen dos

    I need a strong password generator, do you have one? I have been all over the internet and all i find are weak, commonly repeated ones.