Template Categories

templates categories Automobiles
templates categories Business
templates categories CSS Templates
templates categories E-Commerce
templates categories Education
templates categories Fashion
templates categories Greeting Cards
templates categories Hotels
templates categories Jewelry
templates categories kids
templates categories Models
templates categories Music - Films
templates categories Night Club
templates categories Real Estate
templates categories Restaurant
templates categories Software
templates categories Sports
templates categories Travel
templates categories Web-design
templates categories Wedding

Tutorial Categories

tutorial categories AJAX
tutorial categories CSS
tutorial categories Dreamweaver
tutorial categories Flash
tutorial categories FTP - File Transfer
tutorial categories HTML Emails
tutorial categories Javascript
tutorial categories Microsoft Excel
tutorial categories Microsoft Windows
tutorial categories Microsoft Word
tutorial categories MySql
tutorial categories Photoshop
tutorial categories Php
tutorial categories Windows Movie Maker
tutorial categories Xhtml / Html



Creating a LOGIN PAGE with MACROMEDIA DREAMWEAVER

Step I: Create your MySQL database

First we will need to have a database in order to store and add user information. Let's create that now. Keep it very simple with extra frills. I have fields for the id (primary key and auto_increment), username with a VARCHAR of 20, password with a VARCHAR of 20.

Later, when you get comfortable manipulating the code you can add name, email address and levels. Use phpadmin to create the database and the table ( users ) OR use the following SQL

CREATE TABLE `login`.`users` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 20 ) NOT NULL ,
`password` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM

Add atleast one username and password for testing purpose.
Step 2: Create the pages for the login system

Create a folder for your login system and place it in your Web Server's Documents folder. Define a site in Dreamweaver, and set up the Testing Server category. Now let's add the pages we will need. It is usually easier to set them up before you begin adding forms and code. For this tutorial we will have the following pages:

a. index.php OR login.php
b. restricted_page.php

Once the connection is successful use should be able to see the users tablw with details.
dreamweaver-database-connection
Step 3: Create the log in page

Open the login.php page. Insert a form. Here is the image of the form. Add two text boxes and 2 buttons. Use the same names for the text boxes as used in the ' users ' table, that is ' username ' & 'password '.
dreamweaver-login-page
4. Attach server behaviour

Click anywhere inside the form. In the Insert panel goto Application option >> User Authentication tab and select ' login user ' server behaviour. Refer to the image below.
dreamweaver-app-login
5. Setting the parameters

Once you click on the login user server behaviour you will face the following window with 4 sections. Section one gets all the input from the form. Dreamweaver is smart enough to get all the details automatically, since we clicked inside the form before applying the behaviour.

Section two is validating the database connection. Here you can either choose which columns should match the textboxes. Again Dreamweaver does a fine job of allocation appropriate columns.


Section three prompts you to refer to pages after successful login and failure.

And, finally section four asks for the restriction based on your selection. In our case it will be simply username & password and not the second option as shown in the image below.
dreamweaver-form-validation
Like I said earlier in a more advanced form, you can add name, email address and different levels of access. Give it a try. If everything is done according to this tutorial then you should be able to login in with the username & password inserted in the table via phpadmin earlier.