Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once 'connection.php';
- session_start();
- $_SESSION['loggedin'] = false;
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <title>Login</title>
- </head>
- <body>
- <form method='POST'>
- Username: <input type='text' name='user' id='user'><br>
- Password: <input type='password' name='passwd' id ='passwd'><br>
- <input type='submit'>
- </form>
- <?php
- $username = mysqli_real_escape_string($conn, $_POST['user']);
- $password = $_POST['passwd'];
- $hash = mysql_query("SELECT passwd FROM users WHERE username = $username");
- if (password_verify($password, $hash)) {
- // valid, proceed to login
- echo 'hello';
- //$_SESSION['loggedin'] = true;
- //header( 'Location: session.php' );
- exit;
- } else {
- echo 'Focking dipshit';
- exit;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement