PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PHP Random Password Generator

Go down

PHP Random Password Generator Empty PHP Random Password Generator

Post by jamied_uk 2nd June 2016, 16:29



Code:
<title>J~Net PHP Password Generator</title>
<link rel="stylesheet" type="text/css" href="css/button3.css">
<div style="clear:left; height:24px;"></div>
<center>
<div style="float:center; height:auto; min-width:510px;background:#3366FF; margin-left:25px; margin-right:5px; border:#CCC 2px solid;">
<p><br>

<?php
$length = $_POST['pwlength'];
if($length < 1){
$length = 9;
}
$alpha = "abcdefghijklmnopqrstuvwxyz";
$alpha_upper = strtoupper($alpha);
$numeric = "0123456789";
$special = ".-+=_,!@$#*%<>[]{}";
$chars = "";
    // default [a-zA-Z0-9]{9}
$chars = $alpha . $alpha_upper . $numeric . $special;
  //  $length = 9;
$len = strlen($chars);
$pw = '';
for ($i=0;$i<$length;$i++)
        $pw .= substr($chars, rand(0, $len-1), 1);
// the finished password
$pw = str_shuffle($pw);
?>
<style type="text/css">
#breadcrumbsc {
text-decoration: none;
background:#19DB73;
color:#FFF;
padding:1px:1px:1px:1px;
margin-top:5px;
opacity:0.6;
width:270px;
height:30px;
font-size:12;
vertical-align: middle;
line-height: 30px;      /* the same as your div height */
-webkit-transition:opacity 0.5s linear 0s;
transition:opacity 0.5s linear 0s;
} #breadcrumbsc:hover{
opacity:1;
}

input[type=submit] {

border: 1px dotted blue;

cursor:pointer;

transition: box-shadow 1200ms ease-in;

-webkit-transition: box-shadow 1200ms ease-in;
border-radius:5pc;

}

input[type=submit]:hover {
border-radius:5pc;

box-shadow: 0px 0px 15px 10px rgba(255, 255, 255, .75);

}

</style>
<font color="green" style="background-color:white;">

    <h1>J~Net PHP Password Generator</h1>

      <font color="green" style="background-color:white;">

Just a basic password generator. length up to 999, (250 is a good number for databas's) and hit "Generate".
      <form method="POST"  autocomplete="off" action="./">
      <table>
          <tr>
              <p><br><font color="green" style="background-color:white;">
              <td colspan="2" >Password Length</td>
          </tr>
          <tr>
              <td colspan="2"><input type="text" name="pwlength" size="3" maxlength="3" value="<?php echo $length;?>" /></td>
          </tr>
          <tr>
              <td colspan="2"></td>
          </tr>
          <tr>
              <td colspan="2">
                  <div style="padding: 20px 0;"><center><input type="submit" value="Generate" />
<p><br>
                      <div>Your Password:</div>
              </td>
          </tr>
      </table>
    </form>
<div style='border:1px black solid; font-size: 14px; font-family: monospace; padding:3px; color:#000; background-color: #D2E0E6; margin: 0; width:1250; max-height:140px; overflow:auto;'><?php echo $pw;?></div>
<p><br>
</div>

<div id="breadcrumbsc" onclick="location.href='/';" style="cursor: pointer;">
<h2>Back</h2>


</div>
<center>
</div>
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

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