Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>
- Password Generator
- </title>
- </head>
- <body>
- <?php
- echo "<pre>";
- print_r($_POST);
- if(isset($_POST['submit'])){
- function password_generator(){
- $number = $_POST['password'];
- $data = array('a','$','5','%','!','s','9','M','0');
- $result = '';
- for($i=1; $i<=$number; $i++){
- $rand = rand(0,8);
- $result .= $data[$rand].' ';
- }
- return $result;
- }
- $final_result = password_generator();
- }
- ?>
- <fieldset>
- <legend>Password Generator ---- Zubayer Ahamed </legend>
- <form action="" method="post">
- <table>
- <tr>
- <td></td>
- <td></td>
- <td><input type="text" value="<?php if(isset($_POST['submit'])){echo $final_result;} ?>"/></td>
- </tr>
- <tr>
- <td>Password Generator</td>
- <td>:</td>
- <td><input type="text" name="password" placeholder="Enter your number for generate password"/></td>
- </tr>
- <tr>
- <td></td>
- <td></td>
- <td><input type="submit" name="submit" value="SUBMIT"/></td>
- </tr>
- </table>
- </form>
- </fieldset>
- </body>
- </html>
Add Comment
Please, Sign In to add comment