Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

how to display logged in username on a page

5:55 pm on May 2, 2007 (gmt 0)

New User

5+ Year Member

joined:May 1, 2007
votes: 0

lets say that i want to show on my exclusive page "hello,_________"you are now logged in.
I have been serching but so far no luck, maybe the answer is simple, I have no idea.I have the sessions variable up already but that small piece of code is missing to complete the page.
thanks again! This is a great forum.
5:59 pm on May 2, 2007 (gmt 0)


WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
votes: 0

Welcome to WebmasterWorld fatthumb,

usually when the user logs in the username is put into a session or cookie, the username can then be echo'ed from there

6:25 pm on May 2, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
votes: 0

Yes, session or cookie. We have a thread in our library that shows how the session is set after a successful login, and how you could use it on other pages: [webmasterworld.com...]
1:16 am on May 6, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 11, 2005
votes: 0

Hello fatthumb,

I use this ...
$_SESSION['last_url'] = $_SERVER['REQUEST_URI'];
echo "Hello " . $usr;