Advertisement
Guest User

Untitled

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