Graphics Programs Reference
In-Depth Information
Create a page that enables users to log in to the site. You have already created the
login.asp page. Now you will create a form in the login.asp page that allows users
to input their username and password information. You will add the Log In User
server behavior to the page, which will check the database when a user submits the
form to ensure that the username and password are valid. If login is successful, the
database.asp page will appear in the user's browser window. If login is unsuccessful,
the access_denied.html page will be displayed in the browser window.
Restrict access to the pages. You add the Restrict Access To Page server behavior to the
pages that you want to protect, in this case, the database.asp and database_details.asp
pages. After this behavior is added to the pages, users who are not logged in will be
sent to the access_denied.html page.
You'll create the form in the login.asp page, and then add the Log In User server
behavior to the page.
To add content to the login.asp page:
1. Open the login.asp page in Design view, place the insertion point at the right of
the heading text after the closing h1 tag, and then press the Enter key. The inser-
tion point moves to the next line.
2. Insert a form into the page, and then, in the Property inspector, type loginform
in the Form ID box. For this form, it is not necessary to enter information for the
other attributes in the Property inspector because you will add behaviors to con-
trol the form.
3. Click inside of the form area (the dotted red lines), and then insert a table with
3 rows, 2 columns, 80 percent table width, 2 cell padding, 0 border thickness,
2 cell spacing, and no header. A table with three rows and two columns is
inserted into the form.
4. Set the alignment of the left column of the table to Right and Top , and then set
the alignment of the right column of the table to Left and Top .
5. Click in the first cell of the table, type User name: (including the colon), press
the Tab key to move the insertion point to the upper-right cell, and then insert a
text field.
6. Click the OK button to close the Input Tag Accessibility Attributes dialog box, and
then select the text field.
7. In the Property inspector, type username as the ID, set the Char width to 40 , and
then set Max chars to 20 .
8. Click in the middle-left cell of the table, type Password: (including the colon),
press the Tab key to move the insertion point to the next cell, and then insert a
text field with password as the ID, 40 Char width, and 20 Max chars.
Click in the lower-right cell of the table, insert a button, and then set the button
name and value to Login . See Figure 9-38.
Search WWH ::




Custom Search