Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $user = "root";
  4. $pass = "pass";
  5. $db = "SheetPal";
  6.  
  7. mysql_connect($host, $user, $pass);
  8. mysql_select_db($db);
  9.  
  10. if (isset($_POST['username'])){
  11. $username = $_POST['username'];
  12. $password = $_POST['password'];
  13. $sql = "SELECT * FROM users WHERE username ='".$username."' AND password = '".$password."' LIMIT 1";
  14. $res = mysql_query($sql);
  15. if(mysql_num_rows($res) == 1){
  16. echo "You have successfully logged in.";
  17. exit();
  18. }
  19. else {
  20. echo"Invalid login information.";
  21. exit();
  22. }
  23. }
  24. ?>
  25.  
  26. <!DOCTYPE html>
  27. <html >
  28. <head>
  29. <meta charset="UTF-8">
  30. <title>Login Form</title>
  31. <link rel="stylesheet" href="css/login.css">
  32. </head>
  33.  
  34. <body>
  35.  
  36. <body>
  37. <div class="login">
  38. <div class="login-screen">
  39. <div class="app-title">
  40. <h1>Login</h1>
  41. </div>
  42.  
  43. <div class="login-form">
  44. <div class="control-group">
  45. <input type="text" class="login-field" value="" placeholder="username" id="username">
  46. <label class="login-field-icon fui-user" for="login-name"></label>
  47. </div>
  48.  
  49. <div class="control-group">
  50. <input type="password" class="login-field" value="" placeholder="password" id="password">
  51. <label class="login-field-icon fui-lock" for="login-pass"></label>
  52. </div>
  53.  
  54. <a class="btn btn-primary btn-large btn-block" href="test.php">login</a>
  55. <a class="login-link" href="#">Lost your password?</a>
  56. </div>
  57. </div>
  58. </div>
  59. </body>
  60.  
  61.  
  62.  
  63.  
  64. </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement