<%@ LANGUAGE = VBScript %> <% Option Explicit %> <% dim mailer, toAddr, fromAddr, subject, mailText, err, redirect dim name, orgname, address, phone, postcode, city, email, enquiry, spam dim adoRS, adoConn, sql name = request("yourname") orgname = request("orgname") address = request("address") city = request("towncity") email = request("email") postcode = request("postcode") phone = request("phone") enquiry = request("question") spam = request("tickbox") if spam = "1" then spam = "no" else spam = "yes" end if 'error checking if name = "" or orgname = "" or address = "" or city = "" or email = "" or postcode = "" or enquiry = "" then redirect = "involved.html?err=1&yourname="&name&"&orgname="&orgname&"&address="&address redirect = redirect & "&towncity="&city&"&email="&email&"&postcode="&postcode&"&question="&enquiry&"&phone="&phone response.redirect redirect response.end end if if email = "" or inStr(email,"@") = 0 or inStr(email,".") = 0 then redirect = "involved.html?err1=1&yourname="&name&"&orgname="&orgname&"&address="&address redirect = redirect & "&towncity="&city&"&email="&email&"&postcode="&postcode&"&question="&enquiry&"&phone="&phone response.redirect redirect response.end end if If "" & Request.ServerVariables("SERVER_NAME") = "newapacs.devdc.com" Then toAddr = "fraser@dowcarter.com" Else ' toAddr = "ballinger@dowcarter.com" toAddr = "info@chipandpin.co.uk" End If fromAddr = email subject = "Special interest groups - how to get more involved in the program" mailText = vbcrlf mailText = mailText & "Name : " & name & vbcrlf & "Address : " & address & vbcrlf mailText = mailText & "Postcode : " & postcode & vbcrlf & "Town/City : " & city & vbcrlf mailText = mailText & "Telephone : " & phone & vbcrlf & "Email : " & email & vbcrlf mailText = mailText & vbcrlf & "Enquiry : " &enquiry&vbcrlf&vbcrlf& "Receive Updates: " &spam set mailer = new mailerclass mailer.sendEmail fromAddr, toAddr, subject, mailText set mailer = nothing ' better put some stuff into the database too... ' first of all strip out the irritating characters name = Replace(name,"'","'") orgname = Replace(orgname,"'","'") address = Replace(address,"'","'") city = Replace(city,"'","'") email = Replace(email,"'","'") postcode = Replace(postcode,"'","'") enquiry = Replace(enquiry,"'","'") name = Replace(name,",","") orgname = Replace(orgname,",","") address = Replace(address,",","") city = Replace(city,",","") email = Replace(email,",","") postcode = Replace(postcode,",","") enquiry = Replace(enquiry,",","") sql = "insert into inv_enquiries(id,name,orgname,address,city,phone,email,postcode,enquiry,spam,source) values (" sql = sql & "'','" & name & "','" & orgname & "','" & address & "','" & city & "','" & phone & "','" sql = sql & email & "','" & postcode & "','" & enquiry & "','" & spam & "','disability_groups')" set adoConn = Server.CreateObject("ADODB.Connection") adoConn.Open "DSN=candp_dsn" set adoRS = adoConn.Execute(sql) set adoRS=nothing response.redirect "involved_thanks.html" response.end %>