Introduction: set up the project structure and configure the database
  • Introduction and welcome
  • How to use the source code
  • How to organise your code so you write less of it and it's easier to maintain
  • Create a table to store the users and configure the database connection
  • Autoloading classes in PHP
New user signup: create new users in the database
  • The proper way to store passwords securely in your database
  • Using PHP's built-in password hashing functions
  • User signup: add a new user to the database
  • Make sure the signup data is valid before creating the new user
  • Securely storing passwords
Log users in and out, and remember and require login
  • How to make the web browser remember the user between page visits
  • User login: let users identify themselves as registered users of your site
  • User logout: let users safely leave our site and become anonymous again
  • Require users to login before they can see certain content
  • Show certain content to unauthenticated (guest) users only
  • Remember the login: log a user in automatically the next time they visit
  • Log me in and remember me for next time
  • Forget the remembered login if the user logs out
  • Logging in and remembering the login
Reset forgotten passwords and activate new accounts before allowing login
  • The simple, quick and reliable way to send an email from a PHP script
  • Let users safely reset their own passwords when they forget them
  • Reset a forgotten password
  • Make sure a new user's email address is real before allowing them to login
  • Register a new user and activate their account by email
  • Password reset and account activation
User administration: view, edit, create and delete registered users
  • Add administrators to your website to enable administration of other users
  • View a paginated list of all registered users, restricted to administrators only
  • View all the data for a single user
  • Make changes to a user’s data
  • Delete a user from the database
  • Add a new user without them signing up themselves
  • Stop an administrator from locking themselves out or deleting their own user
  • The story so far, alternatives, and what's coming next
  • User administration
Usability, functionality and design improvements
  • Speed up the signup process by validating the signup data using HTML5
  • Add JavaScript and make it easier to code by using the jQuery library
  • Improve the signup process even further by validating using JavaScript
  • Add the same JavaScript validation to the user administration form
  • Add more validation and autofocus to make filling in forms easier
  • Make it look great in minutes, in any browser, without writing any CSS
  • Full source code