Guest User

Untitled

a guest
Mar 15th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php include "config.php"; ?>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>NYPD Warrant syst.</title>
  5. <link rel="stylesheet" href="style.css" type="text/css" />
  6. </head>
  7. <body>
  8. <div id="main">
  9. <?php
  10. if(!empty($_SESSION['Loggedin']) && !empty($_SESSION['Username']))
  11. {
  12. ?>
  13. <h1> NYPD Warrant Area </h1>
  14. Thanks for logging in! You are: <?=$_SESSION['Username']?>
  15. <?php
  16. }
  17. elseif(!empty($_POST['username']) && !empty($_POST['password']))
  18. {
  19.  
  20. $username = mysql_real_escape_string($_POST['username']);
  21. $password = md5(mysql_real_escape_string($_POST['password']));
  22. $verify = mysql_query("SELECT * FROM users WHERE username = '". $username."' AND password = '". $password. "'");
  23. if(mysql_num_rows($verify) == 1)
  24. {
  25. $row = mysql_fetch_array($verify);
  26. $_SESSION['Username'] = $username;
  27. $_SESSION['Loggedin'] = 1;
  28. echo "<h1> Login, Accepted </h1>";
  29. echo "<p>We are now redirecting you to the member area.</p>";
  30. echo "<meta http-equiv='refresh' content='=2;index.php' />";
  31. }
  32. else
  33. {
  34. echo "<h1>Oops, something went wrong!</h1>";
  35. }
  36. }
  37. else
  38. {
  39. ?>
  40. <h1>Member Login</h1>
  41.  
  42. <p>Welcome! Please either login below, or <a href="register.php">click here to register</a>.</p>
  43.  
  44. <form method="post" action="index.php" name="loginform" id="loginform">
  45. <fieldset>
  46. <label for="username">Username:</label><input type="text" name="username" id="username" /><br />
  47. <label for="password">Password:</label><input type="password" name="password" id="password" /><br />
  48. <input type="submit" name="login" id="login" value="Login" />
  49. </fieldset>
  50. </form>
  51.  
  52. <?php
  53. }
  54. ?>
  55.  
  56. </div>
  57. </body>
  58. </html>
Add Comment
Please, Sign In to add comment