The user interface has been simplified in Dreamweaver and later. As a result, you may not find some of the options described in this article in Dreamweaver and later. For more information, see this article.
Your web application can contain a page that lets registered users log in to the site.
A login page is made up of the following building blocks:
A database table of registered users
An HTML form to let users enter a user name and password
A Log In User server behavior to make sure the entered user name and password are valid
A session variable consisting of the user name is created for the user when the user logs in successfully.
You need a database table of registered users to verify that the user name and password entered in the login page are valid.
The next step in building a login page is to add an HTML form to the page to let users log in. See the next topic for instructions.
You add an HTML form to the page to let users log in by entering a user name and password.
An empty form is created on the page. You may have to enable Invisible Elements (View > Visual Aids > Invisible Elements) to see the form’s boundaries, which are represented by thin red lines.
You don’t have to specify an action or method attribute for the form to tell it where and how to send the record data when the user clicks the Submit button. The Log In User server behavior sets these attributes for you.
Add labels (either as text or images) beside each text field, and line up the text fields by placing them inside an HTML table and setting the table’s border attribute to 0.
You can change the label of the Submit button by selecting the button, opening the Property inspector (Window > Properties), and entering a new value in the Label box.
The next step in building a login page is to add the Log In User server behavior to verify that the entered user name and password are valid.
You must add a Log In User server behavior to the login page to ensure that the user name and password that a user enters are valid.
When a user clicks the Submit button on the login page, the Log In User server behavior compares the values entered by the user against the values for registered users. If the values match, the server behavior opens one page (usually the site’s Welcome screen). If the values do not match, the server behavior opens another page (usually a page alerting the user that the login attempt failed).
The server behavior compares the user name and password a visitor enters on the login page against the values in these columns.
The specified page is usually the site’s Welcome screen.
The specified page usually alerts the user that the login process failed and lets the user try again.
If a user tries to access your site by opening a restricted page without first logging in, the restricted page can forward the user to the login page. After the user logs in successfully, the login page redirects the user to the restricted page that forwarded them to the login page in the first place.
When you complete the dialog box for the Restrict Access To Page server behavior on these pages, ensure that you specify your login page in the If Access Denied, Go To box.
A server behavior is added to the login page that ensures the user name and password entered by a visitor are valid.