Integrating PHPbb with PHP websites


#1

Hi.

I want to make a script for my website that recognizes when someone is logged in to PHPbb. So, for instance, if they are logged in to my PHPbb, then they are logged-in at my website as well.

Homepage: Hello guest. Username [ text box ] Password [ text box ] Login
The login button would user phpbb's login.php to log them in. If they are already logged in then:
Homepage: Hello [username].

Does anyone have an idea on how to do this? Or perhaps have a premade script that does this for me? If so, it would be much appreciated.

Thanks!


#2

depending on what the cookie name is for your phpbb, you could have your site read that very cookie and log your user right in. for example, the cookie used for these forums is “phpbb2mysql_data”.

so you could have your site read that cookie like $_COOKIE[“phpbb2mysql_data”] and use that information to log in that user.

now! i haven’t looked at the cookie’s information or attempted to do this before, so it very well could be encrypted and what not. your best bet would be to look at your own phpbb’s source code to see what it does with the cookie.

but, for your short answer, pull in the cookie and see what you can do with the value.