<%Response.Buffer = True%>
<HTML>
<HEAD>
<%
Dim strRemoteIP
strRemoteIP = LCase(Request.ServerVariables("REMOTE_ADDR")) ' Client's IP address
' If you want to track IP login's...
%>
<TITLE>Login Validation</TITLE>
On ERROR RESUME NEXT
' Track login attempts - requires cookies...
' Or if users don't wish to allow cookies, update it to a table...
' This option is the easiest - Instruct users to change thier cookies setting to allow your site
If rs.recordcount <> 1 Then
'Set a log file - give it a 1 hour life
If Request.Cookies("status") = "" Then '1st login attempt
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") > 4 Then
'Ban the IP address for 1 hr - Denies User Login - Adds a record to the database
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("TheXYZ.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
dim objRS
set objRS = server.CreateObject("ADODB.Recordset")
' Set the cursor location to client side (3) -- required
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
MyRedirect = "http://yourcompany.com/XYZ-FOLDER/banned.asp"
Else
MyRedirect = "http://yourcompany.com/XYZ-FOLDER/welcome.asp"
End If
If rs("UserID") <> 0 Then
MyID = rs("UserID") ' Valid Login
'Set the Cookie to the User ID - give it a 1 day life.
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>
<html>
<head>
<title>Re-Directing to Welcome Page</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 in a few seconds.
<br>If you are not re-directed in a 10 seconds, try clicking below.
<br>
You may also get there by clicking
<a href="http://yourcompany.com/XYZ-FOLDER/welcome.asp"
ONMOUSEOVER="window.status='Welcome Page'; return true;"
ONMOUSEOUT="window.status=''; return true;">here</a><br>
</div>
<br><br>
</body>
</html>
<html>
<head>
<title>Welcome Page</title>
<script language="javascript">
function noRightClick() {
if (event.button==2) {
alert('Sorry, while viewing our website your Right Click action has been disabled.')
}
}
document.onmousedown=noRightClick
' Used later in code for navigation buttons - can be removed - BE CAREFUL - BackUP,Edit,Reload...
' Watch for the If - Then Statement when editing....
Select Case Request("Action")
case "<<"
intpage = 1
case "<"
intpage = Request("intpage")-1
if intpage < 1 then intpage = 1
case ">"
intpage = Request("intpage")+1
if intpage > intPageCount then intpage = IntPageCount
Case ">>"
intpage = intPageCount
case else
intpage = 1
end select
%>
<%
rs.AbsolutePage = intPage
For intRecord = 1 To rs.PageSize
Response.Write"<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111'
HERE IS SOME OTHER USEFUL CODE...
EDIT THEN UPDATE THE DATA...
Here is a page getting popcorn orders placed by a scout, that he edits his sales...
<< BEGIN CODE >>
<html>
<head><title>Edit your Popcorn Order</title>
<script language="javascript">
function noRightClick() {
if (event.button==2) {
alert('Sorry, while viewing our website your Right Click action has been disabled.')
}
}
document.onmousedown=noRightClick
</script>
</head>
<body>
<%
' Open the database
Set connupdate = Server.CreateObject( "ADODB.Connection" )
connupdate.Open "Data Source=" & Server.Mappath("TheXYZ.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
Set MyConn=Server.CreateObject("ADODB.Connection")
EmptyTable">
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%">
<p align="center"> Enter or replace the current value with your new count.<br>
You must Submit your changes for the update to occur.</font></td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"
for update verification.
</td><input type="hidden" name="Scout-No" value="<%=MyScoutID%>">
</form></tr>
</table></td>
</tr>
<tr>
<td width="100%"><br>
<p align="center">Your total sales are calculated for you,<br>
please <font color="#FF0000">verify your records</font> after updating your
order.<br>
<font color="#0033CC">Click your <u>Refresh Button</u> if you don't see any
changes!</font></td>
</tr>
</table>
</body>
</html>
<< END CODE >>
==========================================
Here is the page that Updates the data....
==========================================
<< BEGIN CODE >>
<html>
<head><title>Pack 62 - Edit your Popcorn Order</title>
<script language="javascript">
function noRightClick() {
if (event.button==2) {
alert('Sorry, while viewing our website your Right Click action has been disabled.')
}
}
document.onmousedown=noRightClick
</script>
</head>
<body>
<%
' Open the database
Set connupdate = Server.CreateObject( "ADODB.Connection" )
connupdate.Open "Data Source=" & Server.Mappath("scouts.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
Set MyConn=Server.CreateObject("ADODB.Connection")
' after committing the changes, send the user back
' to their scout page
%>
</b>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Re-Direct to Scout Pages</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
redirTime = "4000";
redirURL = "http://yourcompany.com/XYZ-FOLDER/scouts.asp?Scout-No=<%=MyScoutID%>";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
// End -->
</script>
</head>
<body onLoad="redirTimer()">
<div align="center"><img height="148" width="696" src="images/Title_bar.gif"></div>
<p> <div align="center"><h2>Popcorn<br>
Update Complete</h2><br><br>
Please update your prizes.
<br>
Your will be Re-Directed back to your Scout page in a few seconds.<br>
<br>
You may also get there by clicking
<a href="http://yourcompany.com/XYZ-FOLDER/scouts.asp?Scout-No=<%=MyScoutID%>"
ONMOUSEOVER="window.status='Return to your scout page'; return true;"
ONMOUSEOUT="window.status=''; return true;">here</a><br>
<br>
DO NOT USE YOUR BROWSERS BACK BUTTON<br>
THIS WILL RE-SUBMIT YOUR ORDER AGAIN!<br>
</div>
<br><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.