Utilise session control to make sure that, the user has authenticated him/or herself before viewing the page.
Add
in either the globals file, or at the top of every page, before any PHP statements. Add
PHP:
$_SESSION["userAuthenticated"] = true;
to the control structure that checks the login information against a database etc.
Now, whenever you create pages that are only viewable to authenticated users, add this at the top
PHP:
if($_SESSION["userAuthenticated"] != true) {
echo "Hello, user!";
}
else if($_SESSION["userAuthenticated"] != false) {
echo "You must login to view this page.";
}
Another way is you can use a database, but that is completely on a different scope. If this does not work, please be sure to tell me.
If you are having problems implementing it, please let me know, and I will do it for you.