Guest User

Untitled

a guest
Jul 1st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2. /*==========================================================================\
  3. | LeightCMS - Content Management System for Habbo Hotel Private Servers     |
  4. | Compatible with PhoenixEmulator 3.0 (+ higher builds)                     |
  5. | ==========================================================================|
  6. | Revision: 1         Copyright (c) Livar Shekhani               Build: 0.2 |
  7. | My thanks fly to: Jospiek, and Kryptos!                                   |
  8. | ==========================================================================|
  9. | Attention: If any bugs occur contact Livar on RaGEZONE                    |
  10. \==========================================================================*/
  11.  
  12. //Running some required statementS
  13. include 'leight.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.             Header("Location: me.php");
  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