I'd like to be able to access the logged-in user name, group name, etc... from within my own PHP web site.
And to be able to provide login and logout links and/or custom web pages from that same PHP website.
Thank you!
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
<form method="post" action="forum/ucp.php?mode=login">
<label for="username">Username: </label> <input type="text" name="username" id="username" size="40" /><br /><br />
<label for="password">Password: </label><input type="password" name="password" id="password" size="40" /><br /><br />
<label for="autologin">Remember Me?: </label><input type="checkbox" name="autologin" id="autologin" /><br /><br />
<input type="submit" value="Log In" name="login" />
<input type="hidden" name="redirect" value="../index.php" />
</form>
Also interested to find a simple script to do it.
If a XentForo developer could tell us a simple script like this, it would be really helpful as it seems that it is requested often on the forum...
With PHPBB it is easy:
PHP:<?php define('IN_PHPBB', true); $phpbb_root_path = './forum/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?>As explained HERE> https://www.phpbb.com/community/viewtopic.php?f=71&t=643075PHP:<form method="post" action="forum/ucp.php?mode=login"> <label for="username">Username: </label> <input type="text" name="username" id="username" size="40" /><br /><br /> <label for="password">Password: </label><input type="password" name="password" id="password" size="40" /><br /><br /> <label for="autologin">Remember Me?: </label><input type="checkbox" name="autologin" id="autologin" /><br /><br /> <input type="submit" value="Log In" name="login" /> <input type="hidden" name="redirect" value="../index.php" /> </form>
We use essential cookies to make this site work, and optional cookies to enhance your experience.