<%Response.Buffer = True%>
<HTML>
<HEAD>
<%
Dim strRemoteIP
strRemoteIP = LCase(Request.ServerVariables("REMOTE_ADDR")) ' Client's IP address
%>
<TITLE></TITLE>
</HEAD>
<BODY>
<%
' Open a DNS-Less connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Data Source=" & Server.Mappath("scouts.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
set rs = Server.CreateObject("ADODB.Recordset")
' Setup the JOINS, and the relationship within the tables
sql="SELECT tblUsers.UserID, tblUsers.Login, tblUsers.Password "
sql=sql & "FROM tblUsers "
sql=sql & "WHERE tblUsers.Login=" & Chr(34) & Request.Form("Name") & Chr(34)
sql=sql & " AND tblUsers.Password=" & Chr(34) & Request.Form("Password") & Chr(34)
rs.Open sql, conn
On ERROR RESUME NEXT
If rs.recordcount <> 1 Then
'Set a log file - give it a 1 hour life
If Request.Cookies("status") = "" Then
Response.Cookies("status")= 1
Response.Cookies("status").Expires=DateAdd("h",1,Now)
Else
Response.Cookies("status")= Request.Cookies("status") + 1
Response.Cookies("status").Expires=DateAdd("h",1,Now)
End If
End If
'Determine if we ban the IP address
If Request.Cookies("status") > 3 Then 'Wrong Password or Name supplied, Ban the address
Set connupdate = Server.CreateObject( "ADODB.Connection" )
Set rec = server.CreateObject("ADODB.Recordset")
'Create connection to the table, and use OLEDB.4.0 driver
connupdate.Open "Data Source=" & Server.Mappath("scouts.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
dim objRS
set objRS = server.CreateObject("ADODB.Recordset")
' Set the cursor location to client side (3)
objRS.CursorLocation = 3
objRs.open "Select * from tblBannedIP where RecordID = 0", connupdate, 3, 3
objRS.AddNew
objRS.Fields("IP") = strRemoteIP
objRS.Update
objrs.Close
set objrs = Nothing
connupdate.Close
set connupdate = nothing[COLOR=green]
MyRedirect = "/62/banned.asp"
Else
MyRedirect = "/62/scouts.asp"[/color]
End If
'Set a Cookie to the User ID, Bypasses Login - give it a 1 day life.
If rs("UserID") <> 0 Then
MyID = rs("UserID")
Response.Cookies("Scout-No")=MyID
Response.Cookies("Scout-No").Expires=DateAdd("d",1,Now)
End If
rs.Close
set rs = Nothing
conn.Close
set conn = nothing
%>
</BODY></HTML>[COLOR=green]
<html>
<head>
<title>Re-Direct to Scout Pages</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
redirTime = "3000";
redirURL = "<%=MyRedirect%>";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
// End -->
</script>
</head>
<body onLoad="redirTimer()">
<div align="center"><h2>
Please Wait</h2><br>
<br>Processing your Login<br>
<br>You will be Re-Directed to your Scout page in a few seconds.
<br>If you are not re-directed in a few seconds, try clicking below.
<br>
You may also get there by clicking
<a href="/62/scouts.asp"
ONMOUSEOVER="window.status='Return to your scout page'; return true;"
ONMOUSEOUT="window.status=''; return true;">here</a><br>
</div>
<br><br>
</body>
</html>
[/color]