First we should create a table called users.
This is the table that we will check the form fields against. Use the
followig code to create this table. phpMyAdmin is preferred.
| CREATE TABLE users ( username varchar(20) NOT NULL default "", password varchar(20) NOT NULL default "", PRIMARY KEY (ID) ) TYPE=InnoDB; |
After you have created your table populate it at least with one entry, for the sake of example we will use admin for username and admin for password. You are free to populate with your own data.
Now Open your dreamweaver and create a new page called login.php
After you have created your login page make a connection to your database. If you have made a successful connection you should see your Table details in the Application window similar to the screenshot below.

While you are still in login.php page
Choose Applications > Log In User.

Next you will be displayed with a pop up window where you have to make
selections. First part of the window shows details of your form, second
part your database and third part is a redirection process and finally
restriction option based on your database table structure. This window
is quite self explanatory just choose the right option from drop down
menu. If you have a successful connection to your database your
connection will be displayed in the Validate using connection section. If you don"t see your connection in the drop down menu then you have to check your connection again (Step 2).

For Restrict access based on choose Username and password and not Username, password and access level. This is because our table has only username and password fields. After you are done choose OK.
Check Application > Server Behaviors Panel
and you should see your script name there now. You can double click on
it and edit anytime again, in case if you want to redirect to different
page...etc
