Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = new mysqli("localhost", "root", "root", "test");
- if ($con->connect_errno) {
- echo "Fallo al conectar a MySQL: (" . $con->connect_errno . ") " . $con->connect_error;
- }
- $username = $_POST['username'];
- $password = $_POST['password'];
- $sql = "SELECT * FROM users WHERE username = '$username'";
- $result = $con->query($sql);
- if ($result->num_rows == 1){
- $row = $result->fetch_assoc();
- $hash = $row['password'];
- if(password_verify($password, $hash)){
- echo "Yes <br />" . $hash;
- } else {
- echo "No<br/>";
- echo "" . $hash . "<br/>";
- echo $password;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement