Zubrag.com
May 21, 2019, 09:49:51 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How Do I Include logged in user's name on webpage  (Read 9812 times)
jjrose
Newbie
*
Posts: 1


« on: December 26, 2007, 12:46:11 AM »

Hello.

Can you tell me what piece of code to add to the protected webpage that displays the logged-in user's name.  I would say something like these... "Welcome [username]", or "Logged In As [username]". 

I found a piece of code that I think is correct, but I don't know what the exact field name is for the user.  The code I tried was
<?php echo $username; ?>
but it doesn't work.

Thanks
jjrose

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: December 26, 2007, 07:12:54 AM »

Hi.

display user name

Replace as mentioned in that thread. After that you should be able to print user name by including following on your page

<?php echo $login; ?>
Logged
farish.kty
Newbie
*
Posts: 2


« Reply #2 on: November 08, 2011, 07:39:52 AM »

Great code. I connected username and password using mysql database and my user details on mysql database are;
Name: FARISH C.V
username: farish.kty
password: adminpass

Is it possible to print the "Name (FARISH C.V)" on my page from mysql database ? Can you please help me.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC