<%@ Language = VBScript EnableSessionState = False %> <% Dim boolWasPosted 'Indicate whether or not this page was invoked by a POST or not. boolWasPosted = FALSE If( Request.ServerVariables("CONTENT_LENGTH") <> 0 )Then boolWasPosted = TRUE ' function to clean up data Function StripSymbols(sString) Dim nCharPos, sOut, nChar nCharPos = 1 sOut = "" For nCharPos = 1 To Len(sString) nChar = Asc(Lcase(Mid(sString, nCharPos, 1))) If ((nChar > 47 And nChar < 58) or (nChar > 96 And nChar < 123) or nChar = 32) Then sOut = sOut & Mid(sString, nCharPos, 1) End If Next StripSymbols = sOut End Function ' Variables for sending mail message. Dim objCDOMail, strBody, strName, strEmail, strAddress, strCategory, strBotBreaker, strBotBreakerArea, strIPAddress, strUserAgent, strFormReferrer, objConn, strQuery ' Get form field values. strName = StripSymbols(Request.Form("Name")) strAddress = StripSymbols(Request.Form("Address")) & " - " & StripSymbols(Request.Form("City")) & ", " & Request.Form("State") & ", " & Request.Form("Zip") strEmail = Request.Form("Email") strCategory = Request.Form("Category") strBotBreaker = Request.Form("botBreaker") strBotBreakerArea = Request.Form("botBreakerArea") IF strBotBreaker <> "" OR strBotBreakerArea <> "" THEN strIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If strIPAddress="" Then strIPAddress = Request.ServerVariables("REMOTE_ADDR") strUserAgent = Request.ServerVariables("HTTP_USER_AGENT") strFormReferrer = Request.ServerVariables("HTTP_REFERER") ' Construct body of mail message. strBody = "IP Address: " & strIPAddress & vbCrlf & vbCrlf & _ "User Agent: " & strUserAgent & vbCrLf & vbCrLf & _ "Form: " & strFormReferrer & vbCrlf ' Create mail message and send. Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = "WestConn Bot Notifier " objCDOMail.To = "shpuntj@wcsu.edu;veillettes@wcsu.edu" objCDOMail.Subject = "Form Bot " & strFormReferrer objCDOMail.Body = strBody objCDOMail.MailFormat = 0 ' CdoMailFormatMime objCDOMail.Send Set objCDOMail = Nothing ' Create database connection and insert new record. Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\wwwdata\technology\botBreaker.mdb;" strQuery = "INSERT INTO Results(UserAgent, IPAddress, Message, Stamp) values " strQuery = strQuery & "('" & strUserAgent & "', '" & strIPAddress & "', '" & strFormReferrer & "', '" & strDateTime & "');" objConn.Execute strQuery objConn.close Set objConn = Nothing ELSE ' Construct body of mail message. strBody = "Name: " & strName & vbCrlf & vbCrlf & _ "Address: " & strAddress & vbCrlf & vbCrlf & _ "Email: " & strEmail & vbCrlf & vbCrlf & _ "Category: " & strCategory & vbCrlf & vbCrlf ' Create mail message and send. Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = "WestConn Form Submission" & "" objCDOMail.To = "shpuntj@wcsu.edu;mcdonoughe@wcsu.edu" objCDOMail.Subject = "One Book One Community Essay Contest" objCDOMail.Body = strBody objCDOMail.MailFormat = 0 ' CdoMailFormatMime objCDOMail.Send Set objCDOMail = Nothing ' Variables for inserting record into database. Dim strDateTime ' Get date and time for stamp. strDateTime = Date & " " & Time ' Create database connection and insert new record. Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\onebookdanbury\2010\essay.mdb;" strQuery = "INSERT INTO Results(applicantName, applicantAddress, applicantEmail, applicantCategory, Stamp) values " strQuery = strQuery & "('" & strName & "', '" & strAddress & "', '" & strEmail & "', '" & strCategory & "', '" & strDateTime & "');" objConn.Execute strQuery objConn.close Set objConn = Nothing Response.Redirect "http://www.onebookdanbury.org/2010/upload-application.asp?email=" & strEmail & "" END IF Else End If %> One Book, One Community - Danbury, CT

Entry Form

Please complete the following

    ·         One essay per person

    ·         No more than 1,500 words

    ·         Entry must be submitted online

    ·         Essay must be received by Oct. 6, 2011

Bot Breaker


Please do not fill in the following two form fields, they are used to prevent spam