Jump to content

display logged in username


eerikk2

Recommended Posts

hey i am also trying to do something like this, but i want to display the username of the logged in user at the top of my navigation bar on every page and if the user decides to log out the navigation bar no longer would display the username. how about do i do this. i am fairly new to php so a clear explanation would be appreciated.

thank you very much that helped greatly.

 

as for displaying it make a new div tag and put <?=$_SESSION['username']?> as the content to display the username. if no user is logged in nothing will be displayed

 

 

and one other quick question:

I am having it able for users to upload data to a mysql database. how would i store their username in the users column.

I have this as my sql statement

$sql = "INSERT INTO Species(
							user
							)
VALUES (
		'$_SESSION[username];'
		)";

 

however, nothin is being stored, the column is empty

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.