<?php
if(isset($_POST['pwd_length'])){
require "create_pwd.php";
$pwd = new CreatePwd();
$gen_pwd = "Password length: <b>" . $_POST['pwd_length'] . "</b>";
$gen_pwd .= "<br>Case type: <b>" . $_POST['pwd_type'] . "</b>";
$gen_pwd .= "<br><br>Password: <b>" . $pwd->Create($_POST['pwd_length'], $_POST['pwd_type']) . "</b>";
}
else{
$gen_pwd = "";
}
?>
<html>
<head>
<title>CreatePwd - Password Generator</title>
</head>
<body>
Please fill the form to create a new password:
<br><br>
<form action="test_pwd.php" method="post" name="frm1">
Password length: <select name="pwd_length">
<option value="6" SELECTED>6</option>
<?php
for($x=7;$x<15;$x++){
print "<option value=\"" . $x . "\">" . $x . "</option>\n";
}
?>
</select>
<select name="pwd_type">
<option value="lower" SELECTED>lower-case</option>
<option value="upper">upper-case</option>
<option value="mixed">mixed-case</option>
</select>
<input type="submit" value=" Create ">
</form>
<br><br>
<?php print $gen_pwd; ?>
</body>
</html>
|