© David Powers 2019
David PowersPHP 7 Solutionshttps://doi.org/10.1007/978-1-4842-4338-1_19

19. Authenticating Users with a Database

David Powers1 
(1)
London, UK
 

Chapter 11 showed you the principles of user authentication and sessions to password protect parts of your web site, but the login scripts all relied on usernames and passwords stored in a CSV file. Keeping user details in a database is both more secure and more efficient. Instead of just storing a list of usernames and passwords, a database can store other details, such as first name, family name, email address, and so on. Databases also give you the option of using either hashing (one-way and irreversible) or encryption (two-way). In the first section of this chapter, we’ll examine the ...

Get PHP 7 Solutions: Dynamic Web Design Made Easy 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.