fergz,
to start out with, you'll need a way to store and check passwords (either in a database or text file). Then you'll need to keep track of whether a user is logged in or not. This is done most easily with cookies. You can let PHP handle the cookies for you by using it's built-in session functions.
-morgan