UseBB Community

UseBB support, discussion and development

How to build my own login system?

Moderators: Gaia.

Post Reply

Page: 1

Author Post
Member
Registered: Jun 2010
Posts: 2
Hi,

I'd like to make an "auto-login" feature for my users.
I already have a login system for my application, but i'd like when users log in my application, they're also logged in the forum.

I tried to add this code in my app:

define("INCLUDED",1);
define("ROOT_PATH","/home/nico/www/UseBB/");
include('/home/nico/www/UseBB/sources/common.php');
$sql ="SELECT idUser FROM usebb.usebb_members WHERE idUser = $u_id";
//echo $sql;
$req = mysql_query($sql);
$fg = mysql_fetch_assoc($req);
$fid = $fg['idUser'];

$session->update(NULL, $fid);
$functions->set_al($fid, $pass);


But seems not working.
Where should i look to make it?

Thanks for help.
Nico,
Developer
Registered: Apr 2004
Posts: 2230
Location: Belgium
Are you sure the query is correct, since idUser does not exist in the member table.

Also, check the cookie domain and path. It might be best to set the path to '/'.
Member
Registered: Jun 2010
Posts: 2
Lol, you were right, i confused my id with the forum's id. thank you.

Post Reply

Page: 1

UseBB Community is powered by UseBB 1 Forum Software