Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conn = mysqli_connect('localhost', 'root', '', 'classTest');
- if(isset($_POST['submit'])){
- echo "Form was submitted" . '<br>';
- $username = $_POST['username'];
- $password = $_POST['password'];
- $username = mysqli_real_escape_string($conn, $username);
- $password = mysqli_real_escape_string($conn, $password);
- $hashFormat = "$2y$10$";
- $salt = "jskdjfnahdklchaksjfhsl";
- $hashF_and_salt = $hashFormat . $salt;
- $password = crypt($password, $hashF_and_salt);
- echo "Username: " . $username . '<br>';
- echo "Password: " . $password . '<br>';
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Test</title>
- </head>
- <body>
- <form action="test.php" method="post">
- <input type="text" name="username">
- <input type="password" name="password">
- <input type="submit" name="submit" value="submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement