Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Generate a bcrypted crypt password hash</title>
- </head>
- <body>
- <h1>Generate a bcrypted crypt password hash</h1>
- <?php
- if (isset($_POST['password']))
- {
- if (isset($_POST['password_repeat']))
- {
- if ($_POST['password'] == $_POST['password_repeat'])
- {
- echo "Crypted password:<br />".password_hash($_POST['password'], PASSWORD_BCRYPT, array('cost' => 15));
- }
- else
- {
- echo "Entered passwords didn't match!</b>\n";
- }
- }
- }
- ?>
- <p>
- <form method="post">
- Password: <input type="password" name="password" size=20 /><br />
- Repeat: <input type="password" name="password_repeat" size=20 /><br />
- <input type="submit" name="submit" value="Generate hash" />
- </form>
- </p>
- </body>
- </html>
Add Comment
Please, Sign In to add comment