Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:58:02+00:00 2026-05-11T07:58:02+00:00

I’m currently using a PHPBB2 forum for a section of one of my sites,

  • 0

I’m currently using a PHPBB2 forum for a section of one of my sites, and I would like to extend this site (add new pages, scripts, etc). I would like to restrict access to these pages to the users already logged in the PHPBB2 Forum.

In fact, if only members of a certain MemberGroup could access these pages, that would be great.

Is there a way to use the same login credentials on the rest of my site, and to check out which groups the members are from?

Thanks

(by the way, these pages are in PHP)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:58:03+00:00Added an answer on May 11, 2026 at 7:58 am

    If a user is logged into PHPBB, there’s a good chance, though not always likely, that they will then have a cookie that you can read and help with checking who’s who against the database.

    In this case, you’ll want to break the crumbs of the cookie below:

    $_COOKIE['phpbb2mysql_data'] 

    Let’s use an example and blow it out to find the data we need to query against the database. Below is the chunk found in the above cookie:

    a:2:{s:11:'autologinid';s:0:'';s:6:'userid';s:1:'3';} 

    For this, you’ll want to go in and extract that ‘3’ which happens to correspond to the logged in PHPBB user.

    Unserialize that data to yank that user_id out:

     $goo = unserialize($_COOKIE['phpbb2mysql_data']);  $extracted_id = $goo['userid']; 

    (Thanks to epochwolf on pointing out the above serialized form of that cookie)

    That number will be good to run against the database to check out which group the member belongs to. And you would run the check against the phpbb_user_group table (if you had phpbb_ as the prefix of your forum tables.)

    If you didn’t want to keep track of the group IDs from the database, then you will need to do some kind of join and test against the name. Maybe something like this:

    SELECT pug.user_id FROM phpbb_user_group pug   LEFT JOIN phpbb_groups g   ON pug.group_id=g.group_id  WHERE pug.user_id='$extracted_id'  AND g.group_name='Foo'; 

    If you can pull a row out of that, then you’ve found yourself a logged in user who belongs to that Foo group.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
I would like to count the length of a string with PHP. The string
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.