PHP Solutions pp 459-473 | Cite as

Authenticating Users with a Database

  • David Powers


Chapter 9 showed you the principles of user authentication and sessions to password protect parts of your website, but the login scripts all relied on usernames and passwords stored in text files. 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. MySQL also gives you the option of using either one- or two-way encryption. In the first section of this chapter, we’ll examine the difference between the two. Then you’ll create registration and login scripts for both types of encryption.


Advance Encryption Standard Error Message Conditional Statement Unique Index Prepared Statement 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information


Authors and Affiliations

  • David Powers

There are no affiliations available

Personalised recommendations