Advertisement
Guest User

Untitled

a guest
Jan 31st, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <?php include "includes/db.php"; ?>
  2.  
  3. <?php session_start(); ?>
  4.  
  5. <?php
  6.  
  7. if(isset($_POST['submit'])) {
  8.  
  9. global $connection;
  10.  
  11. echo $username = $_POST['username'];
  12. echo $password = $_POST['password'];
  13.  
  14. $query = "SELECT * FROM users WHERE username = '$username', password = '$password'";
  15.  
  16. $result = mysqli_query($connection, $query);
  17.  
  18. $row = mysqli_fetch_assoc($result);
  19.  
  20. $_SESSION['userid'] = $row['userid'];
  21. $_SESSION['username'] = $row['username'];
  22.  
  23. }
  24. ?>
  25.  
  26. <!DOCTYPE html>
  27. <html lang="en">
  28. <head>
  29. <meta charset="UTF-8">
  30. <title>The Akashic Vault</title>
  31. <link rel="stylesheet" href="styles/mainstyle.css" class="css">
  32. </head>
  33. <body>
  34.  
  35. <div class="headerContent">
  36.  
  37. <div class="topmenu">
  38.  
  39. <img src="images/logo.png" alt="" style="margin: 6px;">
  40.  
  41. <form action="index.php" method="post">
  42.  
  43. <input type="text" name="username" class="topinput" value="Username">
  44.  
  45. <input type="password" name="password" class="topinput" value="Password">
  46.  
  47. <input type="submit" class="inputbtn" name"submit" value="Login">
  48.  
  49.  
  50. </form>
  51.  
  52. </div>
  53.  
  54. </div>
  55.  
  56.  
  57.  
  58. </body>
  59. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement