Senior & Expert PHP Developers Discussion Forum by Nyros Technologies

HIRE PHP Expert Developers Programmers Coders From India
PHP .Net Ruby on Rails Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

creating same login for phpbb forum and our custom website

 
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> phpBB
View previous topic :: View next topic  
Author Message
samir



Joined: 12 Nov 2007
Posts: 260

PostPosted: Fri May 16, 2008 10:21 am    Post subject: creating same login for phpbb forum and our custom website Reply with quote

i want to create same login both for my phpbb forum and also my site .i.e when my registred user logins in my site, he should be automatically logged to phpbb forum also....can anyone help me
Back to top
View user's profile Send private message
samir



Joined: 12 Nov 2007
Posts: 260

PostPosted: Fri May 16, 2008 10:27 am    Post subject: Reply with quote

hi i got the solution,
we can create same login both for your site and phpbb forum
u need to paste the following code in your site login page
create $phpbb_user_id with your user id

class PHPBB_Login
{
function PHPBB_Login()
{
}
function login( $phpbb_user_id )
{
global $db, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
// Setup the phpbb environment and then
// run through the phpbb login process

// You may need to change the following line to reflect
// your phpBB installation.
require_once( 'forum/config.php' );

define('IN_PHPBB',true);
//define("IN_LOGIN", true);


// You may need to change the following line to reflect
// your phpBB installation.
$phpbb_root_path = "forum/";

require_once( $phpbb_root_path . "extension.inc" );
require_once( $phpbb_root_path . "common.php" );
//echo $user_ip;
//exit;

return session_begin( $phpbb_user_id, $user_ip, PAGE_INDEX, FALSE, TRUE );

}

function logout( $session_id, $phpbb_user_id )
{
global $db, $lang, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

// Setup the phpbb environment and then
// run through the phpbb login process

// You may need to change the following line to reflect
// your phpBB installation.
require_once( 'forum/config.php' );

define('IN_PHPBB',true);

// You may need to change the following line to reflect
// your phpBB installation.
$phpbb_root_path = "forum/";

require_once( $phpbb_root_path . "extension.inc" );
require_once( $phpbb_root_path . "common.php" );

session_end( $session_id, $phpbb_user_id );

// session_end doesn't seem to get rid of these cookies,
// so we'll do it here just in to make certain.
setcookie( $board_config[ "cookie_name" ] . "_sid", "", time() - 3600, " " );
setcookie( $board_config[ "cookie_name" ] . "_mysql", "", time() - 3600, " " );

}
}
// creating object for the class PHPBB_Login
$obj=new PHPBB_Login;
$obj->login($phpbb_user_id);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> phpBB
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts About foxycart
0 venkatadapa 5 Fri Jul 30, 2010 10:02 am
venkatadapa View latest post
No new posts How to change the mysql storage engine from MyISAM to innodb
1 aababu 10 Fri Jul 30, 2010 9:57 am
venkatadapa View latest post
No new posts How can we increase the execution time of a php script?
0 samir 6 Fri Jul 30, 2010 4:15 am
samir View latest post
No new posts Get no of days between two dates & current dates using M
0 samir 4 Fri Jul 30, 2010 4:09 am
samir View latest post
No new posts What are the different types of errors in php
0 samir 6 Fri Jul 30, 2010 4:00 am
samir View latest post
No new posts How to remove a value in an array using javascript
0 samir 10 Thu Jul 29, 2010 7:27 am
samir View latest post
No new posts Agile methodology plays vital role in software development
0 venkatadapa 7 Thu Jul 29, 2010 7:20 am
venkatadapa View latest post
No new posts How to get complete information about $_SERVER variable
0 Sanjana 15 Wed Jul 28, 2010 6:58 am
Sanjana View latest post
No new posts DNL Reader for php website
0 Mike 22 Mon Jul 26, 2010 12:33 pm
Mike View latest post
No new posts Use mysql_real_escape_string() function to avoid mysql injec
0 venkatadapa 26 Mon Jul 26, 2010 11:05 am
venkatadapa View latest post





Hire an expert PHP developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   .Net   |   Free unlimited HTML CSS Joomla Wordpress Drupal templates download

Nyros Technologies   |   Developers Blog   |   Kakinada City Portal   |   About PHP Experts   |   More