Code: Select all
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
Code: Select all
include($phpbb_root_path . 'common.'.$phpEx);
Code: Select all
include($phpbb_root_path . '/phpBB2/common.'.$phpEx);
Code: Select all
if( $userdata['session_logged_in'] )
{
[insert your HTML/PHP or whatever here]
}
else
{
echo('Please Login');
}
geocator wrote: You got it this far. Then you just use this to hide stuff from guests:Code: Select all
if( $userdata['session_logged_in'] ) { [insert your HTML/PHP or whatever here] } else { echo('Please Login'); }
Code: Select all
<?php
if( $userdata['session_logged_in'] )
{
?>
Code: Select all
Then you put your HTML or PHP coding that you want hiddin unless they are logged in.
Code: Select all
<?php
}
else
{
echo('Must Login to<br>navagate this site!');
}
?>
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '/phpBB2/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
Code: Select all
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
redirect(append_sid($url, true));
}
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '/phpBB2/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
?>
Code: Select all
<?php
if( $userdata['session_logged_in'] )
{
echo "<b><center><font color=#00FF00 size=3><center>Welcome</font></center> ". $userdata['username'];
}
else
{
echo('<font color=#00FF00><center><b>Forums login!</b></center></font>');
?>
<table width="100%"><center>
</b><tr>
<td align="center"><strong>Username:</strong></td></tr><tr>
<td align="center"><form action="/phpBB2/login.php" method="post"><input type="text" name="username" class="textarea" size="18"></td>
</tr>
<tr>
<td align="center"><strong>Password:</strong></td></tr><tr>
<td align="center"><input type="password" name="password" class="textarea" size="18"></td>
</tr>
<tr>
<td align="center"><span class="gen"><font size="2">Log me on automatically each visit:</font></td></tr><tr><td align="center"><input type="checkbox" name="autologin" /></span></td>
</tr>
<tr>
<td align="center"><input type="submit" value="login" name="login" class="textarea"></form></td>
</tr>
<tr>
<td align="center"><span class="gensmall"><a href="/phpBB2/profile.php?mode=sendpassword" class="gensmall">I forgot my password</a></span></td>
</tr>
<tr>
<td align="center"><a href="/phpBB2/profile.php?mode=register" target="_blank">Click here to register</a></span></td></tr></center></table>
<?php
}
?>
Code: Select all
<input type="hidden" name="redirect" value="http://whatever" />
geocator wrote:Code: Select all
<input type="hidden" name="redirect" value="http://whatever" />
geocator wrote: Just use the path like /index.php
DreAdeDcoRpSE wrote:geocator wrote:Just use the path like /index.php
but my problem is that my site is not on the same level as the phpBB2, its actually one level lower, I tried that first and it didnt work so I tried that way, I need to find a way to make it go down 1 level instead of looking on the same or greater level, if possiable.
geocator wrote:DreAdeDcoRpSE wrote:geocator wrote:Just use the path like /index.php
but my problem is that my site is not on the same level as the phpBB2, its actually one level lower, I tried that first and it didnt work so I tried that way, I need to find a way to make it go down 1 level instead of looking on the same or greater level, if possiable.
Try ../ or /../ first.