create an external login script

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Shena678
Registered User
Posts: 1
Joined: Fri Oct 12, 2018 9:19 am

create an external login script

Post by Shena678 » Fri Oct 12, 2018 10:34 am

I'm trying to create an external login script as many other others do. I've borrowed this question from This SO post. I get the message "You're logged in", but when I visit my board I'm not logged in. I'm not sure exactly whats wrong. I apologize if this has been posted somewhere else before.

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = './'; //the path to your phpbb relative to this script
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include("./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', 'Username');
    $password = request_var('password', 'Password');

    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']];
      }
    }
?>
This code is posted in the root directory of my forums, so the phpBB root path is correct. I am running 3.0.12, fresh install, no MODs installed.

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3340
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: create an external login script

Post by HiFiKabin » Fri Oct 12, 2018 10:40 am

I am afraid support for phpBB 3.0.x ended many years ago so we are unable to help you.

We can help you move to 3.2.3 and then we should be able to help with your problem

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: EA117, janus_zonstraal, osama_badr, stevemaury and 25 guests