Third time posting here as it hasn't let me down yet, i have created a website, it is hosted offline @localhost
, i am using Mysqli
and php
to allow users to register on the website and login, when the user registers they are re-directed to a login page, after the login they are then redirected to index.php, what i would like to have is, somewhere at the top of the page a line where it says Logged in as User X
Then maybe Click here to log out, just a simple line, so what i need is after the user logs in it has to retrieve the users name from the database and display it, it doesn't need to be combined with the click here to log out code as i can manage that.
I have been looking online for tutorials but haven't been able to find any that help a great deal, mostly for creating entire user profile structures and i don't want to go that far into it just yet.
As always any help at all is greatly appreciated!
Ryan.
$_SESSION
or$_COOKIE
variable, of the logged in user. If the user wants to log out, just unset the variable