Create a database to keep track of usernames and passwords. Create a script that allows users to register their combinations. Don't forget to check for duplications.
Create an authentication script that checks a username and password. If the user input matches an entry in the database, present the user with a special message. Otherwise, re-present the login form to the user.