% Option Explicit %> <% '##### PROCESS QUESTIONNAIRE FORM ##### 'check to see if this is a form post If Request("postcheck") = "yes" Then 'it is a form post, begin processing form 'Setup Email variables Dim strBody, strFromAddress, strFromName, strToAddress, strToName, strSubject 'Setup Information variables Dim strCurrentCommerce, strAvgMonthlySales, strPayToPromote, strMonthlyToPromote Dim strPromote, strTrack, strEmailFrequency, strEmailInfo, strTypeOfInfo Dim strWebSalesIncreaseExpected, strSiteEmployees, strOtherExpenses, strUseAgencyOrFirm, strApplyOtherExpenses Dim strReportOnCompetition, strKnowProfitMargin, strProfitMargin, strKeptYou Dim strPartner, strWillingToSpend, strMarginExpected, strEmailAddress 'Set up variables for code execution Dim numTrack 'Set up database variables Dim strSQL, objConn 'gather and process info as needed strBody = "" If Request("currentcommerce") = "" Or IsNull(Request("currentcommerce")) Then strCurrentCommerce = "" strBody = strBody & "Commerce on current web site: not selected" & vbCrLf Else strCurrentCommerce = Request("currentcommerce") strBody = strBody & "Commerce on current web site: " & Request("currentcommerce") & vbCrLf End If If Request("avgmonthlysales") = "" Or IsNull(Request("avgmonthlysales")) Then strAvgMonthlySales = "" strBody = strBody & "Average monthly sales: not selected" & vbCrLf Else strAvgMonthlySales = Request("avgmonthlysales") strBody = strBody & "Average monthly sales: " & Request("avgmonthlysales") & vbCrLf End If If Request("paytopromote") = "" Or IsNull(Request("paytopromote")) Then strPayToPromote = "" strBody = strBody & "Pay to promote: not selected" & vbCrLf Else strPayToPromote = Request("paytopromote") strBody = strBody & "Pay to promote: " & Request("paytopromote") & vbCrLf End If If Request("monthlytopromote") = "" Or IsNull(Request("monthlytopromote")) Then strMonthlyToPromote = "" strBody = strBody & "Monthly to promote: not selected" & vbCrLf Else strMonthlyToPromote = Request("monthlytopromote") strBody = strBody & "Monthly to promote: " & Request("monthlytopromote") & vbCrLf End If strBody = strBody & "Where is money spent to promote site: " numTrack = 0 If Not(Request("promote_searchengines") = "" Or IsNull(Request("promote_searchengines"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Search Engines" strPromote = strPromote & "Search Engines" numTrack = numTrack + 1 End If If Not(Request("promote_bannerads") = "" Or IsNull(Request("promote_bannerads"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Banner Ads" strPromote = strPromote & "Banner Ads" numTrack = numTrack + 1 End If If Not(Request("promote_printads") = "" Or IsNull(Request("promote_printads"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Print Ads" strPromote = strPromote & "Print Ads" numTrack = numTrack + 1 End If If Not(Request("promote_television") = "" Or IsNull(Request("promote_television"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Television" strPromote = strPromote & "Television" numTrack = numTrack + 1 End If If Not(Request("promote_radio") = "" Or IsNull(Request("promote_radio"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Radio" strPromote = strPromote & "Radio" numTrack = numTrack + 1 End If If Not(Request("promote_directmail") = "" Or IsNull(Request("promote_directmail"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Direct Mail" strPromote = strPromote & "Direct Mail" numTrack = numTrack + 1 End If If Not(Request("promote_email") = "" Or IsNull(Request("promote_email"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Email" strPromote = strPromote & "Email" numTrack = numTrack + 1 End If If Not(Request("promote_publicrelations") = "" Or IsNull(Request("promote_publicrelations"))) Then If numTrack > 0 Then strBody = strBody & ", " strPromote = strPromote & ", " End If strBody = strBody & "Public Relations" strPromote = strPromote & "Public Relations" numTrack = numTrack + 1 End If strBody = strBody & vbCrLf & "How do you track online marketing effectiveness: " numTrack = 0 If Not(Request("track_sitetraffic") = "" Or IsNull(Request("track_sitetraffic"))) Then If numTrack > 0 Then strBody = strBody & ", " strTrack = strTrack & ", " End If strBody = strBody & "Site Traffic" strTrack = strTrack & "Site Traffic" numTrack = numTrack + 1 End If If Not(Request("track_costpervisit") = "" Or IsNull(Request("track_costpervisit"))) Then If numTrack > 0 Then strBody = strBody & ", " strTrack = strTrack & ", " End If strBody = strBody & "Cost Per Visit" strTrack = strTrack & "Cost Per Visit" numTrack = numTrack + 1 End If If Not(Request("track_costpertransaction") = "" Or IsNull(Request("track_costpertransaction"))) Then If numTrack > 0 Then strBody = strBody & ", " strTrack = strTrack & ", " End If strBody = strBody & "Cost Per Transaction" strTrack = strTrack & "Cost Per Transaction" numTrack = numTrack + 1 End If If Not(Request("track_monthlysalesgrowth") = "" Or IsNull(Request("track_monthlysalesgrowth"))) Then If numTrack > 0 Then strBody = strBody & ", " strTrack = strTrack & ", " End If strBody = strBody & "Monthly Sales Growth" strTrack = strTrack & "Monthly Sales Growth" numTrack = numTrack + 1 End If If Not(Request("track_conversionrate") = "" Or IsNull(Request("track_conversionrate"))) Then If numTrack > 0 Then strBody = strBody & ", " strTrack = strTrack & ", " End If strBody = strBody & "Conversion Rate" strTrack = strTrack & "Conversion Rate" numTrack = numTrack + 1 End If strBody = strBody & vbCrLf If Request("emailfrequency") = "" Or IsNull(Request("emailfrequency")) Then strEmailFrequency = "" strBody = strBody & "Email sending frequency: not selected" & vbCrLf Else strEmailFrequency = Request("emailfrequency") strBody = strBody & "Email sending frequency: " & Request("emailfrequency") & vbCrLf End If strBody = strBody & "What information do you include in emails: " numTrack = 0 If Not(Request("email_specialoffers") = "" Or IsNull(Request("email_specialoffers"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Site Traffic" strEmailInfo = strEmailInfo & "Site Traffic" numTrack = numTrack + 1 End If If Not(Request("email_closeoutmerchandise") = "" Or IsNull(Request("email_closeoutmerchandise"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Closeout Merchandise" strEmailInfo = strEmailInfo & "Closeout Merchandise" numTrack = numTrack + 1 End If If Not(Request("email_tipsoradvice") = "" Or IsNull(Request("email_tipsoradvice"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Tips or Advice" strEmailInfo = strEmailInfo & "Tips or Advice" numTrack = numTrack + 1 End If If Not(Request("email_questionnaires") = "" Or IsNull(Request("email_questionnaires"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Questionnaires" strEmailInfo = strEmailInfo & "Questionnaires" numTrack = numTrack + 1 End If If Not(Request("email_thirdpartyoffers") = "" Or IsNull(Request("email_thirdpartyoffers"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Third Party Offers" strEmailInfo = strEmailInfo & "ThirdPartyOffers" numTrack = numTrack + 1 End If If Not(Request("email_articles") = "" Or IsNull(Request("email_articles"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Articles" strEmailInfo = strEmailInfo & "Articles" numTrack = numTrack + 1 End If If Not(Request("email_discountsorcoupons") = "" Or IsNull(Request("email_discountsorcoupons"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "Discounts or Coupons" strEmailInfo = strEmailInfo & "Discounts or Coupons" numTrack = numTrack + 1 End If If Not(Request("email_whitepapers") = "" Or IsNull(Request("email_whitepapers"))) Then If numTrack > 0 Then strBody = strBody & ", " strEmailInfo = strEmailInfo & ", " End If strBody = strBody & "White Papers" strEmailInfo = strEmailInfo & "White Papers" numTrack = numTrack + 1 End If strBody = strBody & vbCrLf & "What information do you gather from customers: " numTrack = 0 If Not(Request("typeofinfo_age") = "" Or IsNull(Request("typeofinfo_age"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Age" strTypeOfInfo = strTypeOfInfo & "Age" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_sex") = "" Or IsNull(Request("typeofinfo_sex"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Sex" strTypeOfInfo = strTypeOfInfo & "Sex" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_householdincome") = "" Or IsNull(Request("typeofinfo_householdincome"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Household Income" strTypeOfInfo = strTypeOfInfo & "Household Income" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_maritalstatus") = "" Or IsNull(Request("typeofinfo_maritalstatus"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Marital Status" strTypeOfInfo = strTypeOfInfo & "Marital Status" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_profession") = "" Or IsNull(Request("typeofinfo_profession"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Profession" strTypeOfInfo = strTypeOfInfo & "Profession" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_familysize") = "" Or IsNull(Request("typeofinfo_familysize"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Family Size" strTypeOfInfo = strTypeOfInfo & "Family Size" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_shoppinghistory") = "" Or IsNull(Request("typeofinfo_shoppinghistory"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Shopping History" strTypeOfInfo = strTypeOfInfo & "Shopping History" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_mediaconsumption") = "" Or IsNull(Request("typeofinfo_mediaconsumption"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Media Consumption" strTypeOfInfo = strTypeOfInfo & "Media Consumption" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_email") = "" Or IsNull(Request("typeofinfo_email"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Email Address" strTypeOfInfo = strTypeOfInfo & "Email Address" numTrack = numTrack + 1 End If If Not(Request("typeofinfo_outsidedata") = "" Or IsNull(Request("typeofinfo_outsidedata"))) Then If numTrack > 0 Then strBody = strBody & ", " strTypeOfInfo = strTypeOfInfo & ", " End If strBody = strBody & "Outside Data" strTypeOfInfo = strTypeOfInfo & "Outside Data" numTrack = numTrack + 1 End If strBody = strBody & vbCrLf If Request("websalesincreaseexpected") = "" Or IsNull(Request("websalesincreaseexpected")) Then strWebSalesIncreaseExpected = "" strBody = strBody & "Web Sales Increase Expected: not selected" & vbCrLf Else strWebSalesIncreaseExpected = Request("websalesincreaseexpected") strBody = strBody & "Web Sales Increase Expected: " & Request("websalesincreaseexpected") & vbCrLf End If If Request("siteemployees") = "" Or IsNull(Request("siteemployees")) Then strSiteEmployees = "" strBody = strBody & "Site employees: not selected" & vbCrLf Else strSiteEmployees = Request("siteemployees") strBody = strBody & "Site employees: " & Request("siteemployees") & vbCrLf End If If Request("otherexpenses") = "" Or IsNull(Request("otherexpenses")) Then strOtherExpenses = "" strBody = strBody & "Other Expenses: not selected" & vbCrLf Else strOtherExpenses = Request("otherexpenses") strBody = strBody & "Other Expenses: " & Request("otherexpenses") & vbCrLf End If If Request("useagencyorfirm") = "" Or IsNull(Request("useagencyorfirm")) Then strUseAgencyOrFirm = "" strBody = strBody & "Use Agency or Firm: not selected" & vbCrLf Else strUseAgencyOrFirm = Request("useagencyorfirm") strBody = strBody & "Use Agency or Firm: " & Request("useagencyorfirm") & vbCrLf End If If Request("applyotherexpenses") = "" Or IsNull(Request("applyotherexpenses")) Then strApplyOtherExpenses = "" strBody = strBody & "Apply Other Expenses: not selected" & vbCrLf Else strApplyOtherExpenses = Request("applyotherexpenses") strBody = strBody & "Apply Other Expenses: " & Request("applyotherexpenses") & vbCrLf End If If Request("reportoncompetition") = "" Or IsNull(Request("reportoncompetition")) Then strReportOnCompetition = "" strBody = strBody & "Report on Competition: not selected" & vbCrLf Else strReportOnCompetition = Request("reportoncompetition") strBody = strBody & "Report on Competition: " & Request("reportoncompetition") & vbCrLf End If If Request("knowprofitmargin") = "" Or IsNull(Request("knowprofitmargin")) Then strKnowProfitMargin = "" strBody = strBody & "Know Profit Margin: not selected" & vbCrLf Else strKnowProfitMargin = Request("knowprofitmargin") strBody = strBody & "Know Profit Margin: " & Request("knowprofitmargin") & vbCrLf End If If Request("profitmargin") = "" Or IsNull(Request("profitmargin")) Then strProfitMargin = "" strBody = strBody & "Profit Margin: not selected" & vbCrLf Else strProfitMargin = Request("profitmargin") strBody = strBody & "Profit Margin: " & Request("profitmargin") & vbCrLf End If strBody = strBody & "What has kept you from e-commerce: " numTrack = 0 If Not(Request("keptyou_cost") = "" Or IsNull(Request("keptyou_cost"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Cost" strKeptYou = strKeptYou & "Cost" numTrack = numTrack + 1 End If If Not(Request("keptyou_competition") = "" Or IsNull(Request("keptyou_competition"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Competition" strKeptYou = strKeptYou & "Competition" numTrack = numTrack + 1 End If If Not(Request("keptyou_resources") = "" Or IsNull(Request("keptyou_resources"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Resources" strKeptYou = strKeptYou & "Resources" numTrack = numTrack + 1 End If If Not(Request("keptyou_time") = "" Or IsNull(Request("keptyou_time"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Time" strKeptYou = strKeptYou & "Time" numTrack = numTrack + 1 End If If Not(Request("keptyou_noreason") = "" Or IsNull(Request("keptyou_noreason"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "No Reason" strKeptYou = strKeptYou & "No Reason" numTrack = numTrack + 1 End If If Not(Request("keptyou_security") = "" Or IsNull(Request("keptyou_security"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Security" strKeptYou = strKeptYou & "Security" numTrack = numTrack + 1 End If If Not(Request("keptyou_other") = "" Or IsNull(Request("keptyou_other"))) Then If numTrack > 0 Then strBody = strBody & ", " strKeptYou = strKeptYou & ", " End If strBody = strBody & "Other" strKeptYou = strKeptYou & "Other" numTrack = numTrack + 1 End If strBody = strBody & vbCrLf If Request("partner") = "" Or IsNull(Request("partner")) Then strPartner = "" strBody = strBody & "Would you e-commerce with partner: not selected" & vbCrLf Else strPartner = Request("partner") strBody = strBody & "Would you e-commerce with parther: " & Request("partner") & vbCrLf End If If Request("willingtospend") = "" Or IsNull(Request("willingtospend")) Then strWillingToSpend = "" strBody = strBody & "Willing to spend: not selected" & vbCrLf Else strWillingToSpend = Request("willingtospend") strBody = strBody & "Willing to spend: " & Request("willingtospend") & vbCrLf End If If Request("marginexpected") = "" Or IsNull(Request("marginexpected")) Then strMarginExpected = "" strBody = strBody & "Margin expected: not selected" & vbCrLf Else strMarginExpected = Request("marginexpected") strBody = strBody & "Margin expected: " & Request("marginexpected") & vbCrLf End If If Request("emailaddress") = "" Or IsNull(Request("emailaddress")) Then strEmailAddress = "" strBody = strBody & "Email address: not entered" & vbCrLf Else strEmailAddress = Request("emailaddress") strBody = strBody & "Email address: " & Request("emailaddress") & vbCrLf End If 'enter data into database Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open Application("ConnectionString") strSQL = "INSERT INTO Questionnaire(CurrentCommerce,AvgMonthlySales,PayToPromote,MonthlyToPromote,Promote" strSQL = strSQL & ",Track,EmailFrequency,EmailInfo,TypeOfInfo,WebSalesIncreaseExpected,SiteEmployees" strSQL = strSQL & ",OtherExpenses,UseAgencyOrFirm,ApplyOtherExpenses,ReportOnCompetition,KnowProfitMargin" strSQL = strSQL & ",ProfitMargin,KeptYou,Partner,WillingToSpend,MarginExpected,EmailAddress" strSQL = strSQL & ",VisitorIP) VALUES(" strSQL = strSQL & "'" & RemApostLen(strCurrentCommerce,3) & "','" & RemApostLen(strAvgMonthlySales,50) & "'" strSQL = strSQL & ",'" & RemApostLen(strPayToPromote,3) & "','" & RemApostLen(strMonthlyToPromote,50) & "'" strSQL = strSQL & ",'" & RemApostLen(strPromote,256) & "','" & RemApostLen(strTrack,256) & "'" strSQL = strSQL & ",'" & RemApostLen(strEmailFrequency,50) & "','" & RemApostLen(strEmailInfo,256) & "'" strSQL = strSQL & ",'" & RemApostLen(strTypeOfInfo,256) & "','" & RemApostLen(strWebSalesIncreaseExpected,50) & "'" strSQL = strSQL & ",'" & RemApostLen(strSiteEmployees,50) & "','" & RemApostLen(strOtherExpenses,50) & "'" strSQL = strSQL & ",'" & RemApostLen(strUseAgencyOrFirm,3) & "','" & RemApostLen(strApplyOtherExpenses,3) & "'" strSQL = strSQL & ",'" & RemApostLen(strReportOnCompetition,3) & "','" & RemApostLen(strKnowProfitMargin,3) & "'" strSQL = strSQL & ",'" & RemApostLen(strProfitMargin,50) & "','" & RemApostLen(strKeptYou,256) & "'" strSQL = strSQL & ",'" & RemApostLen(strPartner,3) & "','" & RemApostLen(strWillingToSpend,50) & "'" strSQL = strSQL & ",'" & RemApostLen(strMarginExpected,50) & "','" & RemApostLen(strEmailAddress,100) & "'" strSQL = strSQL & ",'" & Request.ServerVariables("remote_addr") & "'" strSQL = strSQL & ");" objConn.Execute strSQL objConn.Close Set objConn = Nothing 'send email to Pete and Brian If strEmailAddress = "" Then strSubject = "ificient Web Site Questionnaire Details: No Address" Else strSubject = "ificient Web Site Questionnaire Details: " & strEmailAddress End If 'SendMail (sSenderName, sSenderAddress, sReceiverName, sReceiverAddress, sSubject, sBody, sRemoteHost, sContentType) 'FOR TESTING: SendMail "ificient Web Site Questionnaire", "info@perficiency.com", "Jeff Demel", "jeff@myverse.net", strSubject, strBody, "mail.perficiency.com", "text" SendMail "ificient Web Site Questionnaire", "info@ificient.com", "ificiency info", "info@ificient.com", strSubject, strBody, "mail.ificient.com", "text" 'send email to visitor, if they provided their email address If Not(strEmailAddress = "") Then strBody = "Thank you for filling out our questionnaire. We are including your responses below, and will send you a copy of the over all summary of survey results when we are finished accepting and compiling them." & vbCrLf & vbCrLf & strBody 'SendMail (sSenderName, sSenderAddress, sReceiverName, sReceiverAddress, sSubject, sBody, sRemoteHost, sContentType) SendMail "ificient", "info@ificient.com", strEmailAddress, strEmailAddress, strSubject, strBody, "mail.ificient.com", "text" End If 'redirect visitor to thank you page Response.Redirect "questions1.asp?sent=yes" End If %>