Monday, 25 July 2011

Random strong password generator

<?php
    if(isset($_POST['generate']))
    {
        $values="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()?";
        $random=rand(8, 12);
    }

?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
         <form method="post">
          <input type="submit" name="generate" value="Generate"/><input type="text" name="submit" value="<?php echo substr(str_shuffle($values),1,$random); ?>"/>
        </form>
    </body>
</html>

No comments:

Post a Comment