But what can I do to prevent the person from bypassing the disclaimer page by just typing in the url? Here's my present code (since I'm a newbie, forgive any bad ideas). There are 3 pages. Disclaimer.htm, DisclaimerError.htm, and Viewer.asp. If the person came from the disclaimer page and clicked on the agreed button the Viewer.asp page would open with no problem. If they click disagree, the page would go to DisclaimerError.htm. But if they just type in the url or who knows where, I want them to be sent to the DisclaimerError.htm (or DisclaimerError.asp, whatever is necessary)
Code for Disclaimer (test) page:
<html>
<head>
<title>Disclaimer Page</title>
</head>
<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<b><font face="Arial,Helvetica" color="#000099" size=+3></font></b> <b><font face="Arial,Helvetica"><font color="#000099"><font size=+3></font></font></font></b>
<center>
<p><b><font face="Arial,Helvetica" color="#000099" size=+3>Disclaimer Page</font></font></font></b><b><font face="Arial,Helvetica"><font color="#000099"><font size=+3></font></b>
<p><b><font face="Arial,Helvetica" color="#000099">By clicking below
you agree to this stuff!!!</font></b></center>
<center>
<table COLS=2 WIDTH="60%">
<tr>
<td>
<form method="POST" action="viewer.asp" name="frmAgree">
<input type="hidden" name="agreed" value="">
<center>
<table COLS=2 WIDTH="60%" >
<tr>
<td>
<center><input type="submit" value="Agree" onClick="frmAgree.agreed.value='yes';"></center>
</td>
<td>
</center><input type="submit" value="Disagree" onClick="frmAgree.agreed.value='no';";></center>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
<b><font face="Arial,Helvetica" color="#000099"></font></b>
</body>
</html>
Code for the DisclaimerError.htm test Page:
<html>
<head>
<title>Disclaimer Page</title>
</head>
<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<b><font face="Arial,Helvetica" color="#000099" size=+3></font></b> <b><font face="Arial,Helvetica"><font color="#000099"><font size=+3></font></font></font></b>
<center>
<p><b><font face="Arial,Helvetica" color="#000099" size=+3>Error
Page...</font></b>
<p><b><font face="Arial,Helvetica" color="#000099">I'm sorry you
cannot view this page without agreeing to our Disclaimer.</font></b>
<p><b><font face="Arial,Helvetica" color="#000099"><a href="Disclaimer.htm">Click
here</a> to go to the Disclaimer Page.</font></b></center>
</body>
</html>
Code for the Viewer.asp test page:
<%Option Explicit
Response.buffer = "true"
'Declare variables
Dim strAgreed
'Grab variables from the querystring.
strAgreed=Request.Form("agreed"
If strAgreed = null or strAgreed = "" Then
Response.Redirect "DisclaimerError.htm"
End If
%>
<html>
<head>
<title>viewer</title>
</head>
<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<center><b><font face="Arial,Helvetica" color="#000099" size=+3>This
is the viewer.htm page.</font></b>
<br><b><font face="Arial,Helvetica" color="#000099" size=+3>You
have successfully viewed and agreed to the disclaimer!</font></b>
<br><b><font face="Arial,Helvetica" color="#000099" size=+3>Thank
You!!!</font></b></center>
</body>
</html>
Thanks for your help!!!