Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <form method="post" action="login.php"><!-- ?mode=login -->
  2.  
  3. <p><input name="username" type="text" id="username" /></p>
  4.  
  5. <p><input name="password" type="password" id="password" /></p>
  6.  
  7. <p><input name="login" class="mainoption" value="Log in" type="submit"></p>
  8.  
  9. </form>
  10.  
  11. ---
  12.  
  13. <?php
  14. define('IN_PHPBB', true);
  15. $phpbb_root_path = "../../../phpBB3/"; //Path to forum (change this)
  16. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  17. include($phpbb_root_path . 'common.' . $phpEx);
  18.  
  19. // Start session management
  20. $user->session_begin();
  21. $auth->acl($user->data);
  22. $user->setup();
  23.  
  24. if($user->data['is_registered'])
  25. {
  26. //Already logged in
  27. }
  28. else
  29. {
  30. $username = request_var('username', '', true);
  31. $password = request_var('password', '', true);
  32. $autologin = (!empty($_POST['autologin'])) ? true : false;
  33.  
  34. $result = $auth->login($username, $password, $autologin);
  35.  
  36. if ($result['status'] == LOGIN_SUCCESS)
  37. {
  38. //Right
  39. }
  40. else
  41. {
  42. //Wrong
  43. }
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement