MyBB Community Forums

Full Version: user login code of mybb in seperate program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to intergrate a new small application with the mybb. I want to use all the existing users who are registered in the mybb and want to use the login module of mybb as it is. Can you please help me what all class/files to be used and how to do write such code..

I am able to login using my login box and the page is redirected to mybb forum. What I want is when login is successful, I want to redirect the page to my program and want to keep that session in my program.
I am using below code in my program after login but getting uid as 0 always even if i have logged in

require_once MYBB_ROOT."global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";
echo $mybb->user['uid'] ;
if($mybb->user['uid'] != 0)
{
// Always getting uid as 0 even if I am logged in..

}


Please help..
lets see your code Smile Also use:
 require MYBB_ROOT."/global.php";
require MYBB_ROOT."/init.php";