Hi,
I am using phpBB3 and wanted to have an external login box from a page that is outside the forum directory. I have searched all over the phpBB3 support forums and haven't much information that was useful.
So, what I would like to put on my site is a special login section with forms for username/password and a login button. After logging in, the code redirects to the forum index (/phpBB3/). If you return back to the personal website outside of the forum directory, and go back to the login area, only a logout button should appear. Clicking on the logout button goes to the forum page confirming logging out, then redirects to the home page of the personal website (outside of forum directory.
I myself am a n00b when it comes to programming (i only have basic knowledge of html but a bit on how to edit css and php).
The code that I found that works close to what I need is: http://area51.phpbb.com/phpBB/viewt...sid=e1a1fbe8c588a2205010f67e13431eea&start=10
PHP code goes in header
PHP forms (basically html)
The above code works for me, its only that I cant get the login/logout redirects to the pages that I want. Anyone with any phpBB3 modding experience? Any help is much appreciated.
Thanks
I am using phpBB3 and wanted to have an external login box from a page that is outside the forum directory. I have searched all over the phpBB3 support forums and haven't much information that was useful.
So, what I would like to put on my site is a special login section with forms for username/password and a login button. After logging in, the code redirects to the forum index (/phpBB3/). If you return back to the personal website outside of the forum directory, and go back to the login area, only a logout button should appear. Clicking on the logout button goes to the forum page confirming logging out, then redirects to the home page of the personal website (outside of forum directory.
I myself am a n00b when it comes to programming (i only have basic knowledge of html but a bit on how to edit css and php).
The code that I found that works close to what I need is: http://area51.phpbb.com/phpBB/viewt...sid=e1a1fbe8c588a2205010f67e13431eea&start=10
PHP code goes in header
Code:
define('IN_PHPBB', true);
define('PHPBB_ROOT_PATH', './phpBB3/');
$phpbb_root_path = 'phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
PHP forms (basically html)
Code:
/* Start Logout*/
if ($user->data['is_registered']){
echo("<form method='post' action='".$phpbb_root_path."ucp.php?mode=logout&sid=".$user->data['session_id']."'>");
echo("<input type='submit' name='logout' value='Logout'>");
echo("<input type='hidden' name='redirect' value='../index.php'>");
echo("<br /></form>");
}
/*End Logout*/
/*Start Login Box*/
if (!$user->data['is_registered']){
echo("form method='post' action='".$phpbb_root_path."ucp.php?mode=login'>");
echo(" Username:");
The above code works for me, its only that I cant get the login/logout redirects to the pages that I want. Anyone with any phpBB3 modding experience? Any help is much appreciated.
Thanks
Last edited: