phpBB3 auto-login

自作多情 提交于 2019-11-30 20:48:09
<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = '../phpBB3/'; //the path to your phpbb relative to this script
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include("../phpBB3/common.php"); ////the path to your phpbb relative to this script
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    $username = request_var('username', 'john');
    $password = request_var('password', '123');

    if(isset($username) && isset($password))
    {
      $result=$auth->login($username, $password, true);
      if ($result['status'] == LOGIN_SUCCESS) {
        echo "You're logged in";
      } else {
        echo $user->lang[$result['error_msg']];
      }
    }
?>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!