Copy link to clipboard
Copied
Hi,
I am trying to get Dreamweaver CS3 or CS4 to show the username of someone that is logged in.
For example:
Welcome (username)
or
You are currently logged in as (username)
Is there any easy way to do this without using ADDT. If someone can help I will be eternaly grateful.
Thanks,
cwhazzoo
Copy link to clipboard
Copied
You don't say which server model you're using, but in PHP/MySQL, Dreamweaver creates a session variable called $_SESSION['MM_Username']. You can use this in any page that uses sessions to display the username. You can also use it to create a recordset that contains other details associated with the user. To do so, set the Filter in the Recordset dialog box to use a Session Variable and enter MM_Username in the field alongside, like this:
You can then use the results of the recordset to create a new session variable that contains the user's full name like this:
$_SESSION['fullName'] = $row_getUserDetails['first_name'] . ' ' . $row_getUserDetails['family_name'];
Since session variables are automatically available in all pages that use sessions (such as pages that use the Restrict Access to Page server behavior), you need create this recordset only once.
ASP and ColdFusion also support sessions, so the basic principle will be the same.
Copy link to clipboard
Copied
Thanks. And yes I am using PHP/MySql.
Copy link to clipboard
Copied
The question is already answered in other thread. Please mark this thread also answered.