3.1. Designing the Login Application

User login applications can be quite simple, such as an application in which the administrator sets up a list of valid users. Anyone who tries to access a protected file is prompted to enter a username and password, which is checked against the list of valid users. On the other hand, a login application can be much more complicated. It can allow the Web site visitor to register for access, setting up his or her own account. The application might collect information from the customers as they register. The application might provide the ability for the users to manage their own accounts. The features that a login application can provide are varied.

The basic function of the login application in this chapter is to allow registered users to enter the Web site and to keep out users who haven't registered. Its second major function is to allow users to register, storing their information in a database. To meet its basic functionality, the user login application should do the following:

  • Give customers a choice of whether to register for Web site access or to log in to the Web site if they're already registered.

  • Display a registration form that allows new customers to type their registration information. The information to be collected in the form is discussed in the following section, "Creating the User Database."

  • Validate the information submitted in the form. Make sure the required fields are not blank and the submitted information is in the correct ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.