|
|
|
|
|
| | |
| |
Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
|
|
Subject: |
Re: Protection |
|
From: |
Harlan |
|
Date: |
1/20/1999 2:46:43 PM |
|
IP: |
206.222.20.2 |
Sure, connect to your database threw odbc and
check that the information they put in the
form matches the database.. Here Ill paste
a function I use often for this.
private sub try_login()
DBOpen() sub function included in db.inc header, creates database connection.
create varaibles for easy access to form input
userid = trim(ucase(request.form("userid")))
password = trim(ucase(request.form("pwd")))
create the sql statement
sSQL = "SELECT * from users where userID=" & userID & " and password=" & password & ""
set rsLogin = db.execute(sSQL)
check there username and password
If rsLogin.EOF and rsLogin.BOF then
session("passed") = False
Else
Do While Not rsLogin.EOF
if ucase(rsLogin("userid")) = userid and ucase(rsLogin("password")) = password then
session("passed") = True
else
session("passed") = False
end if
rsLogin.movenext
loop
End if
if not session("passed") then
incorrect login or domain
session("count") = session("count") + 1
if session("count") >= 3 then
response.write "Failed 3 login attempts"
else
response.write "Invalid UserID or Password<br> Please try again."
call draw_form()
end if
end if
end sub |
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|