MyBB Community Forums

Full Version: Integrating MyBB into your website. (Login Form)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
yahoooo
yes the old cookies was the problem. i've deleted all the cookies and now everything works fine

thanks again TStarGermany i give you a beer when you come in romania Smile
I'm sorry for the repeat post but I'm still having trouble with the dual login. I've even attempted passing the credentials when a user clicks on the link for the forums but nothing works. The goal for my site is single sign-on. Any help?
Hello!

I have used All Instructions for MyBB Integration but still cant login

I am using this code in my root index.php page on top before starting any HTML

Quote:<?php
chdir('forums'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
?>

then i used this code where i should put login form

Quote:<?php

if($mybb->user['uid'])
{
echo "Hey, $mybbuser[username].<br>

Thanks for logging in.";
}
else
{
echo "<table width='100%' border=0>";
echo "<form action='forums/member.php' method='post'><tr><td>
Username:</td><td> <input type='text' name='username' size='20' maxlength='30' /></td></tr>
<tr><td>Password:</td><td> <input type='password' name='password' size='20' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='../index.php' /></td></tr>
<tr><td colspan=2>
<input type='submit' class='submit' name='submit' value='Login' /></form></td></tr>";
echo "</table>";
}
?>


Although i login successfully on forum but when i return on index.php page, i see login form again, it should be remove login form and following message should be display

Quote:Thanks for Loggin in


I think session/cookies cant be start on home page, so i see this problem

anyone can help me?

My website is on home page where i put login form
like www. sitename. com/ index.php
and my forum is placed as

www. sitename. com/ forums/

thanks in advance
I have the same issue as above, and sadly can't fix it Sad

Can somebody help please?
Wish I could help you, but i'm having the same problem.

Seems it's not possible to get the cookie outside of myBB install folder...
so login in forum work fine but i'm not logged when the script send me back to my external login page...

I'm workin on localhost, in a folder called 'chinois', and myBB is installed on a 'forum' folder.

Here are the settings for my cookies :

cookie Domain :
.localhost

cookies path :
/chinois/forum/

A solution would be to use the redirection to acces a private zone, and create your own cookie...but you'll have to modify member.php...
Hi!

I actually solved the issue with it. In order to have the cookies on your complete site, you have to change the cookie path and the cookie domain in the configuration or directly during the installation.

When you are working on the localhost, I would suggest to leave domain blank and the cookie path " / " or pointing to your folder where you have your site.

Hope it helps!
Hi !

Thank you John_S, it works perfectly with these settings :

I'm working on http://localhost/chinois/
my forum is in http://localhost/chinois/forum/
and i'm trying to log on http://localhost/chinois/admin/index)

and my cookie settings are (in forum/inc/settings.php) :
$settings['cookiedomain'] = "";
$settings['cookiepath'] = "/chinois/";


I think you have to set your "root folder" as value for the cookie path, in order to acces them in all your site.

hope it will work online now :p

thanks again john !
instead of using forms to logout, why didnt you just use a simple link?

echo "<a href='./member.php?action=logout&amp;logoutkey=".$mybb->user['logoutkey']."'>Logout</a>";
Hey, well I'm using a CMS which already has a login system implemented in it, and was wondering how I can Integrate the two together so you would have the same account on the website and the forums. I am using Webspell (clan CMS) and was wondering if anyone could help me do this.

Thanks.
This post, ages and ages ago (like a year+ or something) was the first time I tried to write my own PHP (I started with that then done other basic things on my own), I'm still not good, but anyway thanks man.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48