|
-
May 27th, 2011, 12:48 PM
#1
Thread Starter
Frenzied Member
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
-
May 27th, 2011, 01:03 PM
#2
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
-
May 27th, 2011, 01:25 PM
#3
Thread Starter
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|