<%
response.buffer = true
' ==request UserName and Password here==
uid = request("UserName")
pwd = request("Password")
' ==start sanitizing uid and pwd==
ThisUid = true
ThisPwd = true
sChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklm nopqrstuvwxyz"
LenPwd = Len(Uid)
for n = 1 to LenUid
MidUid = Mid(Uid,n,1)
if InStr(sChars, MidUid) = 0 then
ThisUid = false
end if
next
LenPwd = Len(Pwd)
for p = 1 to LenPwd
MidPwd = mid(Pwd,p,1)
if InStr(sChars, MidPwd) = 0 then
ThisPwd = false
end if
next
' ==bounce back to login page if Uid or Pwd is invalid otherwise continue authentication==
if ThisUid = false OR ThisPwd = false then
response.redirect "LoginPage.asp"
else
' --authenticate against database here--
end if
%>
|