Exhibit: Active Server Pages


Information on ASPs can be found at http://www.sitecrafters.com/support/asp/index.asp.


Passwords

For simple password protection of a page or a series of pages, Active Server Pages (ASPs) can be used. The concept is simple: when a password protected page is loaded an ASP script is executed to see if the user entered the correct password. The following information can also be found at http://www.sitecrafters.com/support/fp/index.asp?m=password.asp

Create a login form for your password protected pages.  For example: create a one line text box like the one shown on the example page.  Edit the field properties and enter pwfield for the name and select the Yes radio button for the Password field.  Edit the form properties and select Send to other: Click on Options and enter the name of your ASP protected page or directory page in the Action field for your password protected page. The Method field should say Post, and the Encoding field can be blank.

<body onLoad="document.forms[0].pwfield.focus()">
<form method=
"POST" action="password_protected_page.asp">
<blockquote>
<pre>
Password Required: <input type="password" name="pwfield" size="20"><input type="submit" value="Submit" name="B1">
</blockquote>
</form>
</body>


The script executes when the page loads. If the password has not been entered, or if it's incorrect, the form used to enter the password is loaded. If everything is okay, then the rest of the page loads.

In HTML View, enter the following before the <html> tag in your page. Change the "please" to the new password.  Change "password.htm" to reflect the name of the form page that was used to enter password.


<% 
pagePassword = "letmein"
passwordForm = "password.htm"
IF Session("pwfield") <> pagePassword THEN
     IF Request.Form("pwfield") = pagePassword THEN
          Session("pwfield")= pagePassword
     ELSE 
          Response.Redirect(passwordForm) 
     END IF 
END IF
%>

 

An example of a password protected page can be seen here.  The password is stickboy03.

An actual page that relies on password protection can be seen (but not accessed) here.

Back to Top


Date-Triggered Links

Date-triggered links can be set up as follows:

The triggers must be set up at the beginning of the "body" section.

<! Set up date triggers for notes. >
<%
if date() >= #3/20/2001# AND date() <= #3/28/2001# then
     avail_Link1 = "available_page1.htm"
else
     avail_Link1 = "notes_not_available.htm"
end if

if date() >= #3/29/2001# AND date() <= #5/17/2001# then
     avail_Link2 = "available_page2.htm"
else

     avail_Link2 = "notes_not_available.htm"
end if
%>

And then the actual html links look like:

<a href=<%=avail_Link1%>>Notes Link #1</a>

The page must be saved as an asp file.

 

An example of date-triggered links are shown here

Back to Top