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. |
![]() |
| 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 '. |
![]() |
| 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. |
![]() |
| 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. |
![]() |
| 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. |
About Me :
I am a Web designer from Mumbai India. The recent changes
in web design standards has brought in lots of misunderstandings
and misconceptions. The idea behind the web 2.0 standardisation ....read the complete article
Following are the tools / packages and technologies I use for creating
my websites.
Contact Me :
Please contact me for web-design work
Please fill up the form :