Chapter 1. User Registration

Offering account registration and user logins is a great way of giving users a sense of individuality and serving tailored content. Such authentication is often at the very heart of many community-oriented and e-commerce web sites. Because this functionality is so useful, the first application I present is a user registration system.

From a functional perspective, the system will allow users to create accounts. Members must provide an e-mail address that they can use to validate their registration. Users should also be able to update their passwords and e-mail addresses and reset forgotten passwords. This is pretty standard functionality and what the web users of today have come to expect.

From an architectural standpoint, the directory holding your code should be logically organized. For example, support and include files should be kept outside of a publically accessible directory. Also, user records should be stored in a database. Since there are a large number of tools designed to view and work with data stored in relational databases such as MySQL, this affords transparency and flexibility.

Get PHP and MySQL®: Create-Modify-Reuse 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.