<%@LANGUAGE="VBSCRIPT"%> <% '------------------------------------------------------------------------------------------ ' We want to make sure the form is actually submitted before the code executes, otherwise ' it would execute every time the page loads and send a blank email :o) '------------------------------------------------------------------------------------------ If Request("fldSubmit") <> "" Then strDate = Date() strName = Request("fldName") strEmailAddress = Request("fldEmail") strComments = Request("fldComments") strYear = Request("fldYear") strPostal = Request("fldPostal") strPhone = Request("fldPhone") strNumber = Request("fldNumber") If Not strNumber = "231" Then varError = varError & "* Please enter the security check number
" End If If Not strName <> "" Then varError = varError & "* Please enter your name
" End If If Not strEmailAddress <> "" Then varError = varError & "* Please enter your email address
" End If If Not strYear <> "" Then varError = varError & "* Please select the year you joined the scouts
" End If If Not varError <> "" Then strEmail = "A Scout has completed the registration form on the troop231 website. This form was submitted on " & Date() & " at " & Time() & ". This scout has been added to the news@troop231.org mailing list. The details are below:" & chr(13) & "" strEmail = strEmail & "" & chr(13) & "-----------------------------------------------------" & chr(13) & "SCOUT INFORMATION " & chr(13) & "-----------------------------------------------------" & chr(13) & "" strEmail = strEmail & "The name of the scout is: " If strName <> "" Then strEmail = strEmail & strName & chr(13) & "" End If If strYear <> "" Then strEmail = strEmail & "The scouts became a tenderfoot in: " & strYear & chr(13) & "" End If If strEmailAddress <> "" Then strEmail = strEmail & "The scouts email address is: " & strEmailAddress & chr(13) & "" End If strEmail = strEmail & "" & chr(13) & "-----------------------------------------------------" & chr(13) & "COMMENTS " & chr(13) & "-----------------------------------------------------" & chr(13) & "" If strComments <> "" Then strEmail = strEmail & strComments & chr(13) & "" End If strEmail = strEmail & "" & chr(13) & "-----------------------------------------------------" & chr(13) & "END OF FORM" & chr(13) & "-----------------------------------------------------" & chr(13) & "" Set objRegister = CreateObject("CDONTS.Newmail") objRegister.To = "troop231@abah.org" objRegister.From = "info@troop231.org" objRegister.Subject = "A Registration Form from the Troop231 website" objRegister.Body = strEmail objRegister.Send Set objRegister = Nothing strConfEmail = strConfEmail & "Dear " & strName & chr(13) & chr(13) & "" strConfEmail = strConfEmail & "Thank you for registering as a Troop231 Scout." & chr(13) & chr(13) & "" strConfEmail = strConfEmail & "You became a tenderfoot in: " & strYear & chr(13) & "" strConfEmail = strConfEmail & "Your listed email address is: " & strEmailAddress & chr(13) & "" strConfEmail = strConfEmail & "Your comments were:" & chr(13) & "" & strComments & chr(13) & chr(13) & "" strConfEmail = strConfEmail & "Thank you!" Set objRegister = CreateObject("CDONTS.Newmail") objRegister.To = strEmailAddress objRegister.From = "Troop231 Information " objRegister.Subject = "Registration confirmation from the Troop231 website" objRegister.Body = strConfEmail objRegister.Send Set objRegister = Nothing Set objSubscribe = CreateObject("CDONTS.Newmail") objSubscribe.To = "imailsrv@troop231.org" objSubscribe.From = strEmailAddress objSubscribe.Subject = "" objSubscribe.Body = "subscribe news " & strEmailAddress objSubscribe.Send Set objSubscribe = Nothing Dim strSQL Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\sites\tld\troop231.org\public_html\database\troop231.mdb;" objConn.Open strSQL = "INSERT INTO tblScouts ( fldDate, fldName, fldEmail, fldYear, fldComments, fldPhone, fldPostal ) VALUES ( '" & strDate & "', '" & Replace(strName,"'","''") & "', '" & Replace(strEmailAddress,"'","''") & "', '" & strYear & "', '" & Replace(strComments,"'","''") & "', '" & Replace(strPhone,"'","''") & "', '" & Replace(strPostal,"'","''") & "' )" objConn.Execute strSQL objConn.Close Set objConn = Nothing varDone = True End If End If ' Years Array numYear = 0 varYear = 50 Dim YearsArray(35) Do Until numYear = 36 YearsArray(numYear) = "19" & varYear varYear = varYear + 1 numYear = numYear + 1 Loop %> Troop231.org - Boy Scouts of America

Home Page
Register Your Details
Photo Gallery






<% If varError <> "" Then %>
There are some problems with the details you submitted, please correct the following and resubmit the form:

<%=varError%>
<% End If %><% If Not varDone <> "" Then %>
Please use the form below to register your details. You will also be added to the troop 231 mailing list, you can unsubscribe at any time!

Your Name:
(required)

Your Email Address:
(required)

I became a Tenderfoot in:
(required)

Your Phone Number:


Your Postal Address:


Comments:


Security Check:

Please enter the number in the box:
Eagle =

This website was created by Troop231 Scouts.
<% End If %> <% If varDone <> "" Then %>
Thank you very much for registering, your details have been received successfully!
This website was created by Troop231 Scouts.
<% End If %>

Contact the Webmaster
The Boy Scout logo is copyright © Boy Scouts of America
This website is copyright © <%=Year(Date)%>