<%@LANGUAGE="VBSCRIPT"%> <% Page_Title = "Choirs" %> <% '******************************** Form URL ***********************************' Dim MM_editAction MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString) End If %> <% '******************************* Insert Contact **********************************' If CStr(Request.Form("command_insert")) = "insertform" Then %> <% if(CStr(Request.Form("nametitle")) <> "") then InsertCommand__NameTitleValue = CStr(Request.Form("nametitle")) if(CStr(Request.Form("forename")) <> "") then InsertCommand__ForenameValue = CStr(Request.Form("forename")) if(CStr(Request.Form("surname")) <> "") then InsertCommand__SurnameValue = CStr(Request.Form("surname")) if(CStr(Request.Form("phoneno")) <> "") then InsertCommand__PhoneNoValue = CStr(Request.Form("phoneno")) if(CStr(Request.Form("email")) <> "") then InsertCommand__EmailValue = CStr(Request.Form("email")) if(CStr(Request.Form("addressline1")) <> "") then InsertCommand__AddressLine1Value = CStr(Request.Form("addressline1")) if(CStr(Request.Form("addressline2")) <> "") then InsertCommand__AddressLine2Value = CStr(Request.Form("addressline2")) if(CStr(Request.Form("addressline3")) <> "") then InsertCommand__AddressLine3Value = CStr(Request.Form("addressline3")) if(CStr(Request.Form("addressline4")) <> "") then InsertCommand__AddressLine4Value = CStr(Request.Form("addressline4")) if(CStr(Request.Form("postcode")) <> "") then InsertCommand__PostcodeValue = CStr(Request.Form("postcode")) if(CStr(Request.Form("choirname")) <> "") then InsertCommand__ChoirNameValue = CStr(Request.Form("choirname")) if(CStr(Request.Form("choirleader")) <> "") then InsertCommand__ChoirLeaderValue = CStr(Request.Form("choirleader")) if(CStr(Request.Form("rehearsal")) <> "") then InsertCommand__RehearsalValue = CStr(Request.Form("rehearsal")) if(CStr(Request.Form("venue")) <> "") then InsertCommand__VenueValue = CStr(Request.Form("venue")) if(CStr(Request.Form("contactname")) <> "") then InsertCommand__ContactNameValue = CStr(Request.Form("contactname")) if(CStr(Request.Form("contactphone")) <> "") then InsertCommand__ContactPhoneValue = CStr(Request.Form("contactphone")) if(CStr(Request.Form("contactemail")) <> "") then InsertCommand__ContactEmailValue = CStr(Request.Form("contactemail")) if(CStr(Request.Form("choirwebsite")) <> "") then InsertCommand__ChoirWebsiteValue = CStr(Request.Form("choirwebsite")) if(CStr(Request.Form("choirdetails")) <> "") then InsertCommand__ChoirDetailsValue = CStr(Request.Form("choirdetails")) if(CStr(Request.Form("accept")) <> "") then InsertCommand__AcceptValue = CStr(Request.Form("accept")) %> <% If InsertCommand__NameTitleValue = "" Then MSG = MSG + "Please enter the title\n" If InsertCommand__ForenameValue = "" Then MSG = MSG + "Please enter the forename\n" If InsertCommand__SurnameValue = "" Then MSG = MSG + "Please enter the surname\n" If InsertCommand__PhoneNoValue = "" Then MSG = MSG + "Please enter the phone number\n" If IsEmailValid(InsertCommand__EmailValue) = False Then MSG = MSG + "Please enter a valid email address\n" ' If InsertCommand__AddressLine1Value = "" Then MSG = MSG + "Please enter the address\n" ' If InsertCommand__PostcodeValue = "" Then MSG = MSG + "Please enter the postcode\n" If InsertCommand__ChoirNameValue = "" Then MSG = MSG + "Please enter the choir name\n" If InsertCommand__ChoirLeaderValue = "" Then MSG = MSG + "Please enter the choir leader\n" If InsertCommand__RehearsalValue = "" Then MSG = MSG + "Please enter the day and time of rehearsals\n" If InsertCommand__VenueValue = "" Then MSG = MSG + "Please enter the choir venue\n" If InsertCommand__ContactNameValue = "" Then MSG = MSG + "Please enter the contact name\n" If IsEmailValid(InsertCommand__ContactEmailValue) = False Then MSG = MSG + "Please enter a valid contact email address\n" ' If InsertCommand__ChoirWebsiteValue = "" Then MSG = MSG + "Please enter the choir website\n" If InsertCommand__ChoirDetailsValue = "" Then MSG = MSG + "Please enter the choir details\n" If MSG = "" Then %> <% mailBody = "Choir request by" + VBCrLf + VBCrLf mailBody = mailBody + "Name : " + InsertCommand__NameTitleValue + " " + InsertCommand__ForenameValue + " " + InsertCommand__SurnameValue + VBCrLf mailBody = mailBody + "Phone No : " + InsertCommand__PhoneNoValue + VBCrLf mailBody = mailBody + "Email : " + InsertCommand__EmailValue + VBCrLf mailBody = mailBody + "Address : " + InsertCommand__AddressLine1Value + " " + InsertCommand__AddressLine2Value + " " + InsertCommand__AddressLine3Value + " " + InsertCommand__AddressLine4Value + " " + InsertCommand__PostcodeValue + VBCrLf + VBCrLf mailBody = mailBody + "Choir Details" + VBCrLf + VBCrLf mailBody = mailBody + "Choir Name : " + InsertCommand__ChoirNameValue + VBCrLf mailBody = mailBody + "Choir Leader : " + InsertCommand__ChoirLeaderValue + VBCrLf mailBody = mailBody + "Rehearsal Days and Times : " + InsertCommand__RehearsalValue + VBCrLf mailBody = mailBody + "Venue : " + InsertCommand__VenueValue + VBCrLf mailBody = mailBody + "Contact Name : " + InsertCommand__ContactNameValue + VBCrLf mailBody = mailBody + "Contact Email : " + InsertCommand__ContactEmailValue + VBCrLf mailBody = mailBody + "Website : " + InsertCommand__ChoirWebsiteValue + VBCrLf mailBody = mailBody + "Description : " + InsertCommand__ChoirDetailsValue + VBCrLf Set objCDO = Server.CreateObject("CDONTS.NewMail") objCDO.Subject = "Choir Request" objCDO.BodyFormat = 1 objCDO.Body = mailBody ' objCDO.To = "phil@fatfrogmedia.com" objCDO.To = Website_Email objCDO.From = "postmaster@20000voices.org" If objCDO.Send <> 0 Then CommandCompleted = "N" Else CommandCompleted = "Y" End If Set objCDO = nothing %> <% End If End If %> <% '********************************* Redirect ************************************' If MSG <> "" Then Session("MSG") = MSG End If If (CommandCompleted = "Y") Then RedirectURL = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?Sent=Y" Response.Status="302 Object moved" Response.Redirect(RedirectURL) End If %> <% ' ******************************* Functions ******************************** ' Function IsEmailValid(strEmail) ' Action: checks if an email is correct. ' Parameter: strEmail - the Email address ' Returned value: on success it returns True, else False. Function IsEmailValid(strEmail) Dim strArray Dim strItem Dim i Dim c Dim blnIsItValid ' assume the email address is correct blnIsItValid = True ' split the email address in two parts: name@domain.ext strArray = Split(strEmail, "@") ' if there are more or less than two parts If UBound(strArray) <> 1 Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If ' check each part For Each strItem In strArray ' no part can be void If Len(strItem) <= 0 Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If ' check each character of the part ' only following "abcdefghijklmnopqrstuvwxyz_-." ' characters and the ten digits are allowed For i = 1 To Len(strItem) c = LCase(Mid(strItem, i, 1)) ' if there is an illegal character in the part If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If Next ' the first and the last character in the part cannot be . (dot) If Left(strItem, 1) = "." Or Right(strItem, 1) = "." Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If Next ' the second part (domain.ext) must contain a . (dot) If InStr(strArray(1), ".") <= 0 Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If ' check the length oh the extension i = Len(strArray(1)) - InStrRev(strArray(1), ".") ' the length of the extension can be only 2, 3, or 4 ' to cover the new "info" extension If i <> 2 And i <> 3 And i <> 4 Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If ' after . (dot) cannot follow a . (dot) If InStr(strEmail, "..") > 0 Then blnIsItValid = False IsEmailValid = blnIsItValid Exit Function End If ' finally it's OK IsEmailValid = blnIsItValid End Function %> <%=Website_Name%> - <%=Page_Title%>

Choirs

 
<% If CStr(Request.QueryString("Sent")) <> "Y" Then %>

Please submit the details of your choir to us and we'll place it on our choir list.

Your details (this information will not be added to the website)

 
" size="30" maxlength="100" />
" size="30" maxlength="100" />
" size="30" maxlength="100" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="100" />
" size="30" maxlength="100" />
" size="30" maxlength="100" />
" size="10" maxlength="10" />
 

Choir details (this is the information that will appear on the website)

 
" size="30" maxlength="100" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
" size="30" maxlength="255" />
 
 
 
<% Else %>

 

Thankyou, your choir details have been successfully sent.

go back to our home page

 

 

 

 

 

<% End If %>