FireworksColdFusionDreamweaverFreehandFlashMXHome
Latest New Content

Latest Free Content
View All
Free Content
Accessibility
CMX Learning Guides
Hosted by enterhost

Using the Log In Server Behavior

By: Adrian Senior

Page 1 of 2

Set for printing

Next

In this tutorial, we will look at the Log In user and Restrict access to page Server Behaviors, without enhancements and without any add-ons of any type. We will simply be concentrating on these behaviors as they are supplied to us, straight out of the box, so to speak.

I will be working through these SBs (Server Behaviors) using the ColdFusion server side language. Do not let this put you off - it is completely irrelevant to the tutorial. It could be any of the languages that this feature supports, the methods are the same - exactly the same. All the files you need, including the database, can be downloaded from the foot of this page. You can code along, or use the downloads as a reference for you to work through the tutorial, the choice is yours.

We will begin by making the database and the required tables for the User Authentication SBs to work. I say tables, as the User Authentication SB gives us two options. We can, if required, also set an access level to determine what our users can and cannot see when they enter our protected area. If you do not want to use an access level for your site security then simply ignore the sections that refer to this option, if the procedure differs at all then I will let you know. If I don't, you can assume that the access level reference is safe to ignore.

Creating the database and the required tables

Creating our database

For this tutorial we will use an Access database. Open Access and select the new icon as shown in Image 1; when you do this you will be prompted to save the new database. Navigate to where you want to save it, give it a name of login and then click the create button. At this stage, we have created our new database. At this point it contains no tables, this is our next job. We will be adding two tables to our database, the function of these tables is explained in detail below.

creating the database
Image 1: Creating a new access database

Creating our tables

With our database created and saved, we will be faced with a dialog box, as shown below in Image 2. Before progressing any further, ensure the Tables option is selected. When selected, this button option will show an outline around its edge as you can clearly see in Image 2.

the empty database view
Image 2: The empty database view in Access

The following Flash movie - Movie 1 - will walk you through the process of creating your log in table and defining the attributes of the fields within that table. We will return to this table a little further on in the tutorial to implement the use of access levels within our administration area. For now, we will simply set the base requirements for making use of the User Authentication SBs.


Movie 1:
Creating the basic log in table

Now that we have created the tblLogin table we will create the tblAccessLevel table. We can do this in exactly the same way that we created the tblLogin table. You can follow along with Movie 2 if you feel happier doing that, or you can jump to Movie 3 where I will show you how to create a relationship between the tblLogin and tblAccessLevel tables.


Movie 2: Creating the Access Level table

With our two tables in place we need to create a relationship between the two. This relationship needs to pass the information that exists within the tblAccessLevel table to the tblLogin table. Movie 3 will show us how we can complete this task using an Access database wizard. It is better to relate this table rather than insert the information it contains directly into the tblLogin table. Each access level can be referenced from a single point, so if we have 10 admin users then the information in the tblAccessLevel table (1 entry) is used, rather than inserting the access level into the database 10 times.


Movie 3: Creating the relationship between our tables

That completes the setting up of our Access database. We are now ready to move on to Dreamweaver and create the log in application.

Page 1 of 2 1 2 Next


download
Download Support Files


Keywords
Log In, Filtering users, Filter by username, MM_Username, session variable, Camtasia, video, video demo