<% page = "support" %> <% SC = request("SC") givethanks = 0 errFlag = 0 %> <% clicked = request("clicked") if clicked = "1" then name = validate(request("name")) position = validate(request("position")) postcode = validate(request("postcode")) email = validate(request("email")) family = validate(request("fam")) dfes = validate(request("dfes")) '-------begin validation if len(name) < 2 then errflag = 1 errText = "Name is required." & "
" end if if len(email) < 5 AND len(telephone) < 5 then errflag = 1 errText = errText & "Email is required." & "
" end if if len(email) > 0 AND (InStr(email,".") = 0 OR InStr(email,"@") = 0) then errflag = 1 errText = errText & "Invalid email address." & "
" end if if len(family) < 3 then errflag = 1 errText = errText & "Please select a product family." & "
" end if if len(Position) < 2 then errflag=1 errtext=errtext & "Please include your position." end if '------end validation '------if validated, save in the database if errFlag = 0 then 'make the vars database friendly nameF = LEFT(replace(name,"'","''"),50) positionF = LEFT(replace(position,"'","''"),50) schoolF = LEFT(replace(school,"'","''"),150) addressF = LEFT(replace(address,"'","''"),150) postcodeF = LEFT(replace(postcode,"'","''"),20) emailF = LEFT(replace(email,"'","''"),150) MYSQL = "EXEC Marketing.addtoEmailList @dfes='" & dfes & "', @user_recnum='',@email='" & emailF & "', " MYSQL = MYSQL & "@financeemail='', @Name='" & nameF & "',@Position='" & positionF & "'," MYSQL = MYSQL & "@Department='" & family & "',@productid='', @sourcenum='6', " 'sourcenum=6 means "website" MYSQL = MYSQL & "@postcode='" & postcodeF & "', @site='" & session("site") & "'" rs.Open MYSQL, dsConn res=rs("res") rs.Close givethanks = 1 end if end if %> Exampro - Sign up for emails

Sign up for emails

Sign up for emails to receive competitions, freebies, updates and subject news.
Emails are infrequent and you can unsubscribe at any time.

<% '-----Here we check if the user did a search---- if request("pstcdsrch") = "1" then SearchPostCode = replace(request("SearchPostCode")," ","") SearchPostCode = replace(SearchPostCode,"'","") SearchPostCode = validate(request("SearchPostCode")) if Len(SearchPostCode) > 2 then MYSQL = "EXEC SearchSchoolsPC @postCode='" & SearchPostCode & "'" rs.Open MYSQL, DataConn if not rs.EOF then While NOT rs.eof dfes = rs("dfes") org = rs("org") ad1 = rs("address1") ad2 = rs("address2") '-----Here we loop through search result and build a table---- searchResult = searchResult & "" & dfes & "" & org & "" & ad1 & " " & ad2 & "" rs.MoveNext Wend searchResult = "DfECentreAddress"& searchResult searchResult = "
Click your centre name or enter your details manually
" & searchResult searchResult = "" & searchResult & "
" rs.Close else '------If no records are found, tell them so-------- searchResult2 = "No results found" rs.Close end if '------If less than 3 digits were entered, tell them so-------- else searchResult2 = "Please enter 3 digits of your postcode" end if end if %> <% if Len(SC) < 4 and givethanks=0 then %>
Enter your postcode to find your school
or enter your details manually
<% = SearchResult2 %>
<% = SearchResult %>
<% end if %> <% if Len(SC) > 4 then if SC <> "00000" then 'overseas school MYSQL = "EXEC GetSingleSchool @dfes='" & SC & "'" rs.Open MYSQL, DataConn if not rs.EOF then ' address = rs("addressComplete") postcode = rs("postcode") dfes = rs("dfes") school = rs("org") end if rs.close else dfes = SC end if %>
<< search again
<% if errFlag = 1 OR clicked <> "1" then %> <% end if %> <% 'end if %>
Your name:
Your subject area:
Your position:
Your email:
Centre name:
Centre postcode:
<% = res %>
<% = errText %>
<% end if %> <% 'if givethanks=1 then %> <% 'end if %> <% if givethanks=1 then %> Thank you <% = name %>.
You've been added to our mailing list.
<% end if %>