Operation Manual

610
USING DREAMWEAVER
Building applications visually
Last updated 3/28/2012
The next step in creating a registration page is to add the Insert Record server behavior to insert records in the table of
users in the database.
Update the database table of users
You must add an Insert Record server behavior to the registration page to update the table of users in the database.
1 In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Insert Record from
the pop-up menu.
The Insert Record dialog box appears.
2 Complete the dialog box, making sure to specify the table of users in the database into which the user data will be
inserted. Click OK.
The final step in creating a registration page is to make sure the user name is not used by another registered user.
More Help topics
Build an insert page block by block” on page 589
Add a server behavior to ensure a unique user name
You can add a server behavior to a user registration page that verifies that the user name is unique before adding that
user to your database of registered users.
When the user clicks the Submit button on the registration page, the server behavior compares the user name entered
by the user against the user names stored in a database table of registered users. If no matching user name is found in
the database table, the server behavior carries out the insert record operation normally. If a matching user name is
found, the server behavior cancels the insert record operation and opens a new page (usually a page alerting the user
that the user name is already taken).
1 In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select User
Authentication
> Check New Username from the pop-up menu.
2 In the Username Field pop-up menu, select the form text field that your visitors use to enter a user name.
3 In the If Already Exists, Go To box, specify a page to open if a matching user name is found in the database table,
and click OK.
The opened page should alert the user that the user name is already taken and let the user try again.
Building a login page
About login pages
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.