View Full Version : Login Sytem(phpBB)

Mar 3rd, 2009, 12:09 AM
Ok im not sure if this is the right forum, but please move it if it isn't Thanks.

My problem is im wanting to put the phpBB login system on my site, i have it working so far so that when you put your username and password in, you are logged in to the forums.

However, if i go back to my home page, it still shows the login box as empty, and i would like it to say "You are logged in as 'USERNAME' or what ever, and when you are logged out as ' Welcome Anonymous'.

The code i have for that is:

<form method="post" action="http://www.surrealbb.co.uk/forums/ucp.php?mode=login">
<p><input name="username" type="text" id="username" /></p>
<p><input name="password" type="password" id="password" /></p>
<p><input name="redirect" value="index.php" type="hidden">
<input name="login_submit" class="mainoption" value="Log in" type="submit"></p>
<input type="hidden" name="sid" value="<?= $user->data["session_id"] ?>" />
<input type="hidden" name="login" value="login" />

That works great and it shows the login box. I tired putting:

if ($user->data['user_id'] == ANONYMOUS)
echo 'Please login!';

echo 'Thanks for logging in, ' . $user->data['username_clean'];

around the form but it still didn't do the work.

Does anyone have the code for me as i would like to get this sorted. Also, if you could put the code to put Register, Lost Password etc underneath.

Thanks in advance. If you do not support this, can you send me in the right way, thanks.