Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 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 ($rows<=0 ) {
  19. displayError("You have specified an invalid username or password.");
  20. } else {
  21. $_SESSION['username'] = $username;
  22. echo "Yep";
  23. }
  24. }
  25.  
  26. ?>
  27.  
  28. <form name="input" action="login.php" method="post">
  29. Username: <input type="text" name="username" /><br />
  30. Password: <input type="password" name="password" /><br />
  31. <input type="submit" value="Login" />
  32. </form>
  33.  
  34. <?php
  35. require("footer.php");
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement