You could go an additional step further with this idea. If you lock an account (for example) as a result of 3 failed login attempts, you could have the server automatically EMail the owner of the account advising him/her to change the password due to the attempted hack.
To include that as a feature, replace the sub routine (middle section of my earlier reply) with the following:
Sub chkLoginSession()
strSql="SELECT LFAIL1, LFAIL2, LFAIL3 FROM " & strTablePrefix & "LOGINFAIL WHERE M_NAME='" & FNAME & "'"
set rsFail=my_Conn.Execute(strSql)
if rsFail.EOF then
rsFail.Close
set rsFail=Nothing
strSql="INSERT INTO " & strTablePrefix & "LOGINFAIL (M_NAME, LFAIL1) VALUES ('" & FNAME & "', #" & strForumTimeAdjust & "#)"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsFail=Nothing
else
if DateDiff("d", StrToDate(rsFail("LFAIL1")), strForumTimeAdjust) > 1 then
rsFail.Close
set rsFail=Nothing
strSql="DELETE * FROM " & strTablePrefix & "LOGINFAIL WHERE M_NAME='" & FNAME & "'"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsFail=Nothing
strSql="INSERT INTO " & strTablePrefix & "LOGINFAIL (M_NAME, LFAIL1) VALUES ('" & FNAME & "', #" & strForumTimeAdjust & "#)"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsFail=Nothing
else
if rsFail("LFAIL2")="" then
strSql="INSERT INTO " & strTablePrefix & "LOGINFAIL (M_NAME, LFAIL2) VALUES ('" & FNAME & "', #" & strForumTimeAdjust & "#)"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsFail=Nothing
end if
if rsFail("LFAIL3")="" then
strSql="INSERT INTO " & strTablePrefix & "LOGINFAIL (M_NAME, LFAIL3) VALUES ('" & FNAME & "', #" & strForumTimeAdjust & "#)"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsFail=Nothing
else
' Notify account holder
strSql="SELECT M_NAME, M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME='" & FNAME & "'"
set rsNotify=my_Conn.Execute(strSql)
if not rsNotify.EOF then
strRecipientsName = FNAME
strRecipients = rsNotify("M_EMAIL")
strFrom = strSender
strFromName = strForumTitle
strsubject = "Possible Hacking Attempt on Your Account at " & strForumTitle
strMessage = "Hello " & FNAME & vbNewline & vbNewline
strMessage = strMessage & "You received this message from " & strForumTitle & " because there were three consecutive unsuccessful attempts to login using your user name at " & strForumURL & "." & vbNewline & vbNewline
strMessage = strMessage & "If these attempts WERE made by you and you have forgotten your password, you can reset it by clicking the link below." & vbNewLine & vbNewLine
pwkey = GetKey("none")
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET M_PWKEY = '" & chkString(pwkey,"SQLString") & "'"
strSql = strSql & " WHERE M_NAME = " & FNAME
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
strMessage = strMessage & strForumURL & "password.asp?pwkey=" & pwkey & vbNewline & vbNewline
strMessage = strMessage & "If these attempts WERE NOT made by you, you should change your password using your profile page (" & strForumURL & "pop_profile.asp?mode=Edit) as soon as possible to prevent an eventual 'brute force' password breaking." & vbNewLine & vbNewLine
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
rsNotify.Close
end if
set rsNotify=Nothing
Response.Redirect "127.0.0.1"
Response.End
end if
end if
end if
End Sub