views:

40

answers:

1

I have a site with a phpBB forum and I have a separate login through a different page. I want it so when a user logs in, it will display a "Welcome, 'Username'!" message and when they are not logged in it says, "Welcome, Guest!". I just can't find the syntax to get the username.

I don't really have any code so far that has gotten anywhere, but I was looking for something in the realm of:

<?php 
     echo "<span class = 'WelcomeStyle'>Welcome, " . $username . "!</span>";
?>

Except, where do I get the variable $username? If this helps I did the login system by linking to the login page of the forums, with the code here:

<form method = "post" action = "http://www.ravenwolfguild.net/forum/ucp(Copy).php?mode=login"&gt;
<span class = "LoginLabelStyle">Login:&nbsp;&nbsp;</span>
<input name = "username" type = "text" id = "username" placeholder = "Username"/>
<input name = "password" type = "password" id = "password" placeholder = "Password"/>
<input name = "redirect" value = "../LoginTest.php" type = "hidden">
<input name = "login" class = "mainoption" value = "Log in" type = "submit">
</form>

Thanks in advance for any help.