It's not that hard to do, first of all you need a database (ideally) to store the users' details. Then, you need to plan out what information you need to store, a simplified example would be:
QUOTE
tblUsers(username, password)
Where username is the primary key, and a unique string and password is a fixed length string which cannot be null. Then, you create a registration form, which validates input, checks if the username is taken, and salts and hashes the password. If the input is all well and good then we use an INSERT statement to add that user to the database. The next part is working out a login system. We would take their username and password, hash the password as it was hashed before and sanitise the username then use a SELECT to see if the user exists with that username/password combination. If yes then we log them in. The actual logging in can be done in two ways, the first being a session, and the other being pure cookies (sessions use a cookie, but that is automated so they can be seen as separate). You'll want to look into the security implications of each method and make a choice based on those.
Then, on that page you were describing you could check for a valid login, if we've got one then display a welcome message and if not redirect away and kill the page.
"How to make a login" is really as vague as my answer, and I don't want to write an essay right now. So have a read of the above and if you get stuck then ask some specific questions.