The_FedEx_Guy wrote:
> I'm sorry. I have included the files below:
You seem to be doing things in a very roundabout way. Both
header.php
and login.php include db.php, and both of them call
session_start().
Also, your code to display the welcome message displays the
name only if
$_SESSION['logged'] is *not* true.
You don't need header.php at all. You simply need to create a
session
variable for the username at the same time as
$_SESSION['logged']:
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
$_SESSION['logged'] = true;
$_SESSION['sessFirstName'] = $_POST['username'];
Then later:
<div class="userWelcome"><?php {
echo 'Welcome '. $_SESSION["sessFirstName"];
} ?></div>
Note that the condition looks like this:
if ($_SESSION['logged'])
You had this:
if ($_SESSION['logged'] == "true")
That means: if $_SESSION['logged'] contains the string,
"true". However,
$_SESSION['logged'] doesn't contain a string; it's a Boolean
(true/false) variable.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/