Creating Login Page
Home » Tutorials » Dreamweaver
Note: Before you attempt this tutorial you should have some DB server running on your computer such as MySql. If not download dev5beta3.exe and install PHP, Apache and MySql together with phpMyAdmin with one click, and you will be ready for all the dynamic tutorials.
This tutorial will teach you how to make a login page in Dreamweaver MX. At the end of the tutorial you will have a page where users can enter their username and password and if the username and password which they entered match the records in the database they will be allowed to enter the restricted page in other words redirected to the members area.
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 ''
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 Here is the page and here is the code for creating that form with the two fields.
After you have created your login page make a connection to your database. (Go to Connecting to Database Tutorial if you don't know how to make a connection) If you have made a successful connection you should see your Table details in the Application window similar to the screenshot below.