Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * Coded by `P R O D I G Y™
  5. * @copyright 2011 - InterBB
  6. * This source is released as free, under the GNU-GPL License.
  7. */
  8.  
  9. require("header.php");
  10.  
  11. $username = clean($_POST['username']);
  12. $password = hash('sha512', $_POST['password']);
  13.  
  14. if (isset($_POST['username']) && isset($_POST['password'])) {
  15. $sql = mysql_query("SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . $password . "' LIMIT 1")or die(mysql_error());
  16. $rows = mysql_num_rows($sql);
  17.  
  18. if (count($rows) > 0) {
  19. $_SESSION['username'] = $username;
  20. echo "Yep";
  21. }
  22. else {
  23. displayError("You have specified an invalid username or password.");
  24. }
  25. }
  26.  
  27. ?>
  28.  
  29. <form name="input" action="login.php" method="post">
  30. Username: <input type="text" name="username" /><br />
  31. Password: <input type="password" name="password" /><br />
  32. <input type="submit" value="Login" />
  33. </form>
  34.  
  35. <?php
  36. require("footer.php");
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement