User Authentication - Introduction
A lot of sites add a members section, where users are authenticated by means of a username and password. Once the user is logged in successfully, he or she can then gain access to the restricted areas of the site. You'll see how to do that in this walkthrough.
For the walkthrough, there are some scripts already prepared. These can be found in the login folder, which is one of the folders you downloaded. (It's in the scripts folder.)
In this walkthrough, we'll explore some of the things you need to bear in mind when creating a username/password section on your site. What we don't offer is a complete login script. This is, after all, a tutorial site, and we'd much rather help you develop your own scripts. Other things you need to consider before implementing a login section on your site are discussed at the end of this section. You need to read these!
A word about the database used for this section
The database we've set up for these tutorials is as simple as they come. It consists of a table called login, with three fields: an ID field, a field for the username (called L1), and a field for the password (called L2). We're using a simple table, so as not to complicate the tutorials. But you'll want to add more fields, when you come to implement your own login pages. The database can be found in the databases folder. Copy this to the data directory of your mysql folder, just like you did before.
The database table has a test username and password set, so that you can try it out. The username is usernameTest and the password is passwordTest. Also, make sure cookies are enabled in your browser. You'll see why, later.
But click the next part to get started.