When a user tries to log in,
(make a login.php with these)
- take the user name and password via POST
- check these within the database
- if these two matches with the registry, start a session
- save the user name or user id (user id is better since it will be definitely unique) into a session variable
- set a header redirect to actual page like index.php
- in index.php, use that session variable to get specific data from database
- and voila, show what you need to echo in the screen
for reference:
http://php.net/manual/en/ref.session.php