OK, Logout needs some additional features (in addition to the cookie clear out above) to completely clear the session.
Very simply, just add the following code to a seperate page and amend the variables to suit your site.
PHP:
// *** Logout the current user.
// specify the redirect after logout
$logoutGoTo = "../index.php";
// if there is no session, start session
if (!isset($_SESSION)) {
session_start();
}
//Specify all session variables and null them out
$_SESSION['Username'] = NULL;
$_SESSION['WorkgroupID'] = NULL;
$_SESSION['AccessLevel'] = NULL;
$_SESSION['Usertimezone'] = NULL;
$_SESSION['Usertimeformat'] = NULL;
//unset all session variables
unset($_SESSION['Username']);
unset($_SESSION['WorkgroupID']);
unset($_SESSION['AccessLevel']);
unset($_SESSION['Usertimezone']);
unset($_SESSION['Usertimeformat']);
//use the redirect variable to forward to another specified page after logout.
if ($logoutGoTo != "") {header("Location: $logoutGoTo");
exit;
}
I use this on my site - check it out.
As for your other issue, I'm not sure if you want this "title" to alter depending on who is logged in. If this is what you want, simply add another field to the users record [TITLE, varchar (30)]
The admin entry form (which I'm assuming you can create) would then simply update that record with the new title.
To show it on your index page, there are two mthods I can think of.
1) set the [TITLE] from the database as a session variable like $_SESSION['var_page_title'] and then on each page you want to show it, simply use echo.
PHP:
<?php echo $_SESSION['var_page_title'];?>
The other solution is a bit more complex and involves creating a recordset on each page that automatically loads from the DB.
You can then echo as before
PHP:
<?php echo $row_RecordsetOfTitle['TITLE'];?>
...I prefer the session route and again, I use this method for users with time or timeformat preferences.