<% If request.querystring("entered")="error" Then %> <% Response.write("

You have already voted in this poll.
Thank You.

") %> <% Else %> <% recaptcha_challenge_field = Request("recaptcha_challenge_field") recaptcha_response_field = Request("recaptcha_response_field") recaptcha_public_key = "6LezehsTAAAAAJNIw2hiARukMGu3IEHEvBALG7VT" recaptcha_private_key = "6LezehsTAAAAAJcSGGBvy4Kpp5vdZuSSV2G1J7qO" ' returns the HTML for the widget function recaptcha_challenge_writer() recaptcha_challenge_writer = _ "" & _ "" & _ "" end function ' returns "" if correct, otherwise it returns the error response function recaptcha_confirm(rechallenge,reresponse) Dim VarString VarString = _ "privatekey=" & recaptcha_private_key & _ "&remoteip=" & Request.ServerVariables("REMOTE_ADDR") & _ "&challenge=" & rechallenge & _ "&response=" & reresponse Dim objXmlHttp Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objXmlHttp.open "POST", "http://www.google.com/recaptcha/api/verify", False objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objXmlHttp.send VarString Dim ResponseString ResponseString = split(objXmlHttp.responseText, vblf) Set objXmlHttp = Nothing if ResponseString(0) = "true" then 'They answered correctly recaptcha_confirm = "" else 'They answered incorrectly recaptcha_confirm = ResponseString(1) end if end function server_response = "" newCaptcha = True if (recaptcha_challenge_field <> "" or recaptcha_response_field <> "") then server_response = recaptcha_confirm(recaptcha_challenge_field, recaptcha_response_field) newCaptcha = False end if %> <% if server_response <> "" or newCaptcha then %> <% if newCaptcha = False then %> There was a problem with the code you entered below. Please try again. <% end if %>

Participate in the Democracy and Me online Presidential Election Poll. Fill out the registration form below and we'll send you everything needed for your students to vote in our online poll. You'll receive results both for your school and the all the students participating. Thank you!

<% IF Date()>#10/30/2016# THEN %>

If you have already registered, you can begin voting here.

<% END IF %>

Teacher's Name:
 

Teacher's Email:

Subjects Taught:

Number of Students:

School:

School Address:

City:

State:

Zip Code:


<%=recaptcha_challenge_writer()%>
<% else %> <% Dim my_num,max,min max=150 min=2 Randomize my_num=int((max-min+1)*rnd+min) %> <% teacher_first=request.form("teacher_first") teacher_last=request.form("teacher_last") email=request.form("email") subjects=request.form("subjects") students=request.form("students") school=request.form("school") address=request.form("address") city=request.form("city") statename=request.form("state") zip=request.form("zip") schoolcode=Replace(school,"'","''") schoolcode=Replace(schoolcode,".","''") schoolcode=Left((schoolcode),3) teachercode=Replace(teacher_last,"'","''") teachercode=Replace(teachercode,".","''") teachercode=Left((teachercode),3) idcode=schoolcode & teachercode & my_num url="sendregemail.php?teacher_first=" & teacher_first & "&teacher_last=" & teacher_last & "&email=" & email & "&subjects=" & subjects & "&students=" & students & "&school=" & school & "&address=" & address & "&city=" & city & "&state=" & statename & "&zip=" & zip & "&idcode=" & idcode 'Response.Write (url) 'Response.End 'url="thankyou.html" '************************FILL CONTACT DATABASE Set Conn = Server.CreateObject("ADODB.Connection") ConnStr="Provider=SQLNCLI11; Data Source=WEB\SQLEXPRESS; Database=democracy_me; Integrated Security=SSPI;" Conn.Open(ConnStr) sql = "INSERT INTO poll_registration(teacher_first,teacher_last,email,subjects,students,school,address,city,state,zip,idcode,signup_date)" sql = sql & "VALUES( " sql= sql & "'" & Replace(teacher_first,"'","''") & "'," sql= sql & "'" & Replace(teacher_last,"'","''") & "'," sql= sql & "'" & Replace(email,"'","''") & "'," sql= sql & "'" & Replace(subjects,"'","''") & "'," sql= sql & "'" & Replace(students,"'","''") & "'," sql= sql & "'" & Replace(school,"'","''") & "'," sql= sql & "'" & Replace(address,"'","''") & "'," sql= sql & "'" & Replace(city,"'","''") & "'," sql= sql & "'" & Replace(statename,"'","''") & "'," sql= sql & "'" & Replace(zip,"'","''") & "'," sql= sql & "'" & idcode & "'," sql= sql & "'" & Now() & "')" 'Response.Write (sql) 'Response.End Set cmdTemp = Server.CreateObject("ADODB.Command") cmdTemp.CommandText = sql cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = Conn cmdTemp.Execute Conn.Close Set Conn = Nothing Set cmdTemp = Nothing Response.Redirect (url) end if end if %>