Guest User

Untitled

a guest
Jul 1st, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <?php
  2. /*==========================================================================\
  3. | NyanCMS - Content Management System for Habbo Hotel Private Servers |
  4. | Compatible with PhoenixEmulator 3.0 (+ higher builds) |
  5. | ==========================================================================|
  6. | Revision: 1 Copyright (c) Cormac O'Reilly Build: 0.2 |
  7. | My thanks fly to: NukaHotel, and Habplot Hotel! |
  8. | ==========================================================================|
  9. | Attention: If any bugs occur contact Livar on RaGEZONE |
  10. \==========================================================================*/
  11.  
  12. //Running some required statementS
  13. include 'Nyan.php';
  14.  
  15. //Adding our Page and some Parameters!
  16. $tpl->AddParam("Login_Error", "");
  17.  
  18. if(isset($_POST["login_username"]) && isset($_POST["login_password"]))
  19. {
  20. $username = $_POST['login_username'];
  21. $query = $db->prepare("SELECT * FROM `users` WHERE username = '$username'")->execute();
  22.  
  23. if($query->num_rows() == 1)
  24. {
  25. $password = $app->passwordHash($_POST['login_password']);
  26. $query_login = $db->prepare("SELECT `password` FROM `users` WHERE username = '$username'")->execute();
  27. $correct = $query_login->result();
  28.  
  29. if($correct == $password)
  30. {
  31. $_SESSION['Leight_Username'] = $username;
  32. echo 'You have logged in!';
  33. }
  34.  
  35. else
  36. {
  37. $tpl->AddParam('Login_Error', 'Invalid password combination!');
  38. }
  39. }
  40.  
  41. else
  42. {
  43. $tpl->AddParam('Login_Error', 'Username does not exist!');
  44. }
  45. }
  46.  
  47. //Add our Page
  48. $tpl->AddTemplate('page-frontpage');
  49.  
  50. ?>
Add Comment
Please, Sign In to add comment