Click to See Complete Forum and Search --> : Restricting access w/o a login


mangeloni
01-28-2003, 11:29 PM
I have a form/page in which I only want to be accessable to the user after entering data from a previous form/page. I cannot use DW4's "restrict access to page" server behavior since my path for the user is not based upon the user logging in - but I do not want the user to access this 2nd page directly.

Any suggestions?

~MVA

vickers_bits
01-29-2003, 12:08 AM
what language are you using?

mangeloni
01-29-2003, 07:53 PM
I am primarily using Javascript/ASP...but am open to other languages/techniques if necessary.

~MVA

vickers_bits
02-01-2003, 02:01 AM
if the first form submits to the second and all form elements must have values, use something like (vbscript)
If Request.Form(0)="" Then Response.Redirect "form1.asp"

or you could use a simple session variable on the first form
on the second form if the variable doesn't match then redirect

mangeloni
02-01-2003, 10:28 PM
The first page writes data to one table, while the next writes to another - with a confirmation page in between. I already have session variables set in the first page (Javascript)...My session variable is "AdminUserName" and is a key/unique data.

So, how would I use this SV on the second page in order to redirect to another page?

Please be specific - as I am new to coding.

Thanks!

~MVA

vickers_bits
02-02-2003, 08:39 AM
well your current SV(AdminUserName) doesn't inform you of whether the first form has been submitted correctly so you should add a new SV on the confirmation page eg:

Session("completedForm") = "yes"

then on the second form:

If Session("completedForm") <> "yes" Then
Response.Redirect "firstform.asp"
Else
Session.Contents.Remove("completedForm")
End If

ps cookies must be enabled on the client for SVs

Ribeyed
02-02-2003, 08:55 AM
hi,
<%
if session("AdminUserName") = "" then

response.redirect "backtoanotherpagebecauseaccessisdenyed.asp"

else

response.write "Do all your page code here. If the AdminUserName SV is empty for any reason then this page will not be displayed. "

end if

%>

Hope this helps