Advertisement
Guest User

Untitled

a guest
May 29th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2.   include_once 'connection.php';
  3.   session_start();
  4.   $_SESSION['loggedin'] = false;
  5. ?>
  6.  
  7. <!DOCTYPE html>
  8. <html lang='en'>
  9. <head>
  10.   <title>Login</title>
  11. </head>
  12. <body>
  13.   <form method='POST'>
  14.     Username: <input type='text' name='user' id='user'><br>
  15.     Password: <input type='password' name='passwd' id ='passwd'><br>
  16.   <input type='submit'>
  17.   </form>
  18.  
  19.   <?php
  20.     $username = mysqli_real_escape_string($conn, $_POST['user']);
  21.     $password = $_POST['passwd'];
  22.     $hash = mysql_query("SELECT passwd FROM users WHERE username = $username");
  23.  
  24.  
  25.     if (password_verify($password, $hash)) {
  26.         // valid, proceed to login
  27.         echo 'hello';
  28.         //$_SESSION['loggedin'] = true;
  29.         //header( 'Location: session.php' );
  30.         exit;
  31.     } else {
  32.         echo 'Focking dipshit';
  33.         exit;
  34.     }
  35.   ?>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement