how much simpler could it be?
You create a form that posts data to some page..login.php for instance..
on that page you check the $_POST variables agains the data in your database.. if you find a username and a pasword in some record matching the posted one --- assign user id to a session ($_SESSION varible array)
Then on every page that has to be unique or user has to be loged in you simply check the $_SESSION['userid'] (if thats the one that stores user id) and use it for quering the database to be able to create a unique page.. thats all
How much simpler could it be?
In case you cant simply think logical -- try drawing some logick-schemes and logic-trees.. that might help... in case that doesnt help -- i suggest you first practice on doing that.. BEFORE you start programming.. and get some tutorial as well..