Guest User

Untitled

a guest
May 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include ('include/config.php');
  4. include ('encrypt.php');
  5. if(isset($_POST['login'])) {
  6.  
  7. $account = substr($_POST['account'], 0, 15);
  8. $password = substr($_POST['password'], 0, 20);
  9. $blowfish = encrypt($password);
  10.  
  11.  
  12. $sql = "SELECT * FROM user_auth with (nolock) where account=:account AND password=CONVERT(binary, :password) ";
  13. $stmt = $dbconnect->prepare($sql);
  14. $stmt->execute(array(':account' => $account, ':password' => $blowfish));
  15. if($stmt->rowCount() == 1)
  16. {
  17. $_SESSION['account'] = $account;
  18. $_SESSION['LoggedIn'] = TRUE;
  19. header("location:index.php");
  20. }
  21. else
  22. {
  23. echo "Incorrect username or password.";
  24. }
  25. }
  26. ?>
  27.  
  28. <html>
  29. <head>
  30. <title>Lineage 2 Control Panel</title>
  31. <link rel="stylesheet" type="text/css" href="style.css" />
  32. </head>
  33. <body>
  34.  
  35. <div class="logo"></div>
  36.  
  37. <div class="login">
  38. <center>
  39. <form method="POST" action="" >
  40. <table border="0">
  41.  
  42. <tr><td>&nbsp;Username</td></tr>
  43. <tr><td><input type="text" name="account" size="25" /></td></tr>
  44.  
  45. <tr><td>&nbsp;Password</td></tr>
  46. <tr><td><input type="password" name="password" size="25" /></td></tr>
  47. <tr><td>&nbsp;<a href="">Forgot password?</a></td></tr>
  48. <tr><td><input type="submit" value="Login" name="login" /></td></tr>
  49.  
  50. </table>
  51. </form>
  52. </center>
  53. </div>
  54.  
  55. </body>
  56. </html>
Add Comment
Please, Sign In to add comment