JDT

 

FREE Downloads
Articles
Tutorials

 

Using PHP and MySQL to Create a User Authentication System - Part 1 - Introduction


When developing dynamic web sites, it is often necessary to provide some kind of user authentication to make certain parts of the site available only to registered users of that site. Many sites have 'members only' areas, for example, access to forums is often protected. Getting visitors to register is a good way of building up a community of users, but your content needs to be good enough to keep them coming back.

In this set of tutorials we will look at a user authentication system that has been developed using PHP and MySQL. The system is available as a free download.

This is also the user authentication system used by Earnings Tracker, JDT's free accounting / bookkeeping software tool for contractors and freelancers.

The Files

At the centre of the authentication system is the user class (user_class.php), which contains methods (functions) to:

  • enable a user to register
  • authenticate a user
  • enable a user to update their profile (name, email address and password)

In addition to the user class file, there are several other files that form part of the user authentication system, many of which interact with the user class file. The complete list of files is:

  • database_and_tables.sql - SQL file to create the database and user table
  • genpass.php - forms part of the process to generate a password
  • gpl.txt - GNU General Public License (Version 2, June 1991) - the license determining the use of the authentication system
  • index.php - the home page
  • login.htm - the login form
  • loginfailed.php - displayed when a login attempt fails
  • logout.php - log out file
  • newpassword.htm - form to request a new password
  • regcomplete.php - forms part of the registration process
  • register.htm - the registration form
  • registerfailed.htm - displayed when user enters an email address that already exists in the database table
  • updateDetails.php - forms part of the process to enable a user to change their profile
  • updateDetails1.php - forms part of the process to enable a user to change their profile
  • user_class.php - the user class
  • welcomeAfterLogin.php - displayed after a successful logon attempt.

Part 2 - Installing the Files


Author: Backrubber
John Dixon Technology Ltd

Reference: user_class.php is based on functions described in the book 'Apache, MySQL, and PHP Web Development for Dummies', by Jeff Cogswell (ISBM 0-7645-4969-3).







Go back to MySQL Tutorials home page

Go back to Tutorials home page



Earnings Tracker is John Dixon Technology's FREE accounting and bookkeeping software tool.

Aimed at contractors and freelancers, Earnings Tracker enables you to perform bookkeeping and accounting tasks, helping you to keep track of your company's revenue and spending.

The software is written in PHP and MySQL and is available to use for FREE online, or as a FREE download.

Earnings Tracker can also be used simply as a dividend, corporation tax, or VAT calculator.

Need free accounting software
 


JDT

Copyright Notice for John Dixon Technology Ltd

Privacy Statement

Terms & Conditions