-
Prevent opening page
Hi everyone.
I'm kinda new to ASP I need your help in my login form.
I already coded the login/pword authentication. I have a question though. How do i prevent users from bypassing the login form.
What is the code to make sure a page underwent a login authentication first?
Here is a snippet of my login/password code.
Code:
strSQL="SELECT * FROM Table WHERE Login = '" & request.form("userfield") & "' and Password = '" & request.form("pwordfield") & "'"
set rs = Global_DBConnection.execute(strSQL)
dim blnAuth
If Not (rs.EOF and rs.BOF) Then
blnAuth = True
End if
if blnAuth = True then
response.Redirect("success.html")
response.End()
elseif blnAuth = False then
response.Redirect("Fail.html")
response.End()
end if
set rs = nothing
Now in this example i want to protect the success.html for any bypass. Thanks in advance.
-zynder
-
Re: Prevent opening page
you wouldn't use an html page... usually the way these things work is upon sucessful login, a cookie is set... then you redirect to a new page... then you page (in fact ALL pages) will need to check that cookie. if it's set, then the user has logged in and can proceed. If it isn't set, then they are sent back to the login page. all of this requires server side processing, either in ASP or PHP or Perl, or something, and so isn't usually done with just html.
-tg
-
Re: Prevent opening page
Thanks for the tip. Yes i will change it to asp. I'm just trying to grasp this asp/server side scripting.
OK now do you have some links on cookie tutorials? That's just i need methinks.