In Chapter 12, "Creating a Database Table," you followed a two-step table-creation process. You can use that same process to create the authorized users table.
Open your web browser to http://127.0.0.1/show_createtable.html.
In the Table Name field, type auth_users.
In the Number of Fields field, type 4.
Click on the Go to Step 2 button. You should see a form with four rows, corresponding to the four fields that will be in the auth_users table.
In the first row, type f_name for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 50. This field will hold the user's first name.
In the second row, type l_name for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 50. This field will hold the user's last name.
In the third row, type username for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 25. This field will hold the user's username.
In the fourth row, type password for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 100. This field will hold a hash of the password.
| Note |
If you recall from Chapter 7, "Displaying Dynamic Content," a hash is like a digital summary of the string. It can be used to compare versions of strings (or files) to determine whether the versions differ. |
The completed form should look like the following figure.
Click on the Create Table button. You should see a confirmation screen stating that your table has been created. In the next section, you create a record addition form and script, and add users to the auth_users table.