Basically you will need to have a database that stores information about the user. For example you could have a table that stores all the information about the user. Lets call it "users".
Within in that have some fields. say "username", "password", "email address", "real_name".
when the user submits the login form you need to query the database and find the matching user name and password. something like the following.
SELECT * FROM users
WHERE username = $POST['username']
AND password = $POST['password']
Where the $POST['username'] $POST['password'] are the details the user entered.
You will then have all the details matching that correct user. After that you can then display the data however you desire.
Hope that helps.