Forum Moderators: coopster

Message Too Old, No Replies

How to display a logged in user on the page

display logged in user

         

gorgeous1

12:33 pm on Nov 26, 2008 (gmt 0)

10+ Year Member



I am very new to PHP but...

I have been reading the old threads [webmasterworld.com...] , although these are helpful if you are hand scripting; using dreamweaver is slightly different.

I have managed to create an answer.

When you use the Log in user wizard in Dreamweaver, it sets up a session variable equal to the username. it usually looks like MM_Username

From this you are able to put a small piece of code any where you would like the username to display on the page

<?php echo $_SESSION['MM_Username']; ?>

It works for me, but can not promise it would for anyone else; I just hope it saves someone some time.

Anyango

12:36 pm on Nov 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld gorgeous1!

If you call session_start() before you read or write $_SESSION values then it should pretty much work mostly everywhere

IMHO If You are new to PHP, as You mentioned, i would suggest You to stay away from dreamweaver. A plain text editor will help in your "learning" much more.

[edited by: Anyango at 12:38 pm (utc) on Nov. 26, 2008]

gorgeous1

4:49 pm on Nov 26, 2008 (gmt 0)

10+ Year Member



Thank you for your advice, Anyango.