Adding Security Pages

See Also

You can combine HTML forms with client and server script to secure your site. Since ASP pages generate what your visitor sees dynamically before sending it to the browser, you can also control what code and text is visible as source code in your visitor's browser. Typical security pages include login or registration pages. For example, you can add login pages that control entrance to the rest of the application.

The actual pages and script you add to establish security depend on what your design goals are. The following procedure provides one way to implement security pages on your site.

To add security pages

  1. Add an HTML form to your main site page that gathers user identification and password information. For details, see Gathering Information Using Forms.

  2. In the main site page, add client script that verifies that values were entered in the form. For details, see Adding Scripts.

  3. In a database, add a table that stores the user identification and password information.

  4. In the project, add a connection to the database and table. For details, see Connecting to a Database.

  5. Create an ASP page that retrieves a record based on the user input and compares the input with the values in the database.

  6. Add server script that handles failed logins and successful logins that link to the site.