Chapter 3. Building a Login Application

In This Chapter

  • Designing the login Web page

  • Building the database to store user information

  • Writing the code for the login application

Many Web sites are secret or have secret sections. Such Web sites require users to log in before they can see the secret information. Here are some examples of situations in which Web sites might restrict access:

  • Many online merchants require customers to log in so that their information can be stored for future transactions. The customer information, particularly financial information, needs to be protected from public view.

  • Many Web sites need to restrict information to certain people. For instance, company information might be restricted to company staff or members of a certain department.

  • Information is available for sale, so the information needs to be restricted to people who have paid for it.

User login is one of the most common applications on the Web, with many uses. We're sure you've seen and logged in to many login applications.

If you only need a simple login screen, the example scripts provided in Chapters 1 and 2 of this minibook may be sufficient for your needs. In this chapter, we show you how to build a more complex login application. The login application in this chapter allows users to register or to login if they are already registered. It collects and stores information from users when they register. It provides a fairly complex Login Web page with two forms: one for login and one for registration. ...

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.