MyBB Central

Full Version: Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anybody know how to make it so when a user logs into my main site with their account that it also logs them into MyBB? And also if they register for the site it registers them to the forum also?
For a system login in your website, you can use this simple PHP script:

PHP Code:
<?php
chdir
('/home/public_html/forums'); //Change this for your path to your forum directory
define("IN_MYBB"1);
require 
'./global.php';

/* These three lines (above) must be at the beginning of the file */

if($mybb->user['uid']) {
     
//If it's logged in
}
else {
     
//If it's not logged.
}
?>

This will log your users in. Both, website and forum.
For registration just make a form, and action would be redirected to the registering script of MyBB. So make sure you copy all the fields required in the original registration form of MyBB. Better take a look at the registration file.
Have you gotten this solved