<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Contact Us page ' Product : CandyPress Store Frontend ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true %> <% 'Email dim emailTo dim emailName dim emailFrom dim emailSubject dim emailBody 'Work Fields dim arrayErrors dim formID 'Database dim mySQL dim conntemp dim rstemp 'Session dim idOrder dim idCust '************************************************************************* 'Open Database Connection call openDb() 'Store Configuration if loadConfig() = false then call errorDB(langErrConfig,"") end if 'Get/Set Cart/Order Session idOrder = sessionCart() 'Get/Set Customer Session idCust = sessionCust() 'Get Form or QueryString parms emailName = validHTML(Request("emailName")) emailFrom = validHTML(Request("emailFrom")) emailSubject = validHTML(Request("emailSubject")) emailBody = validHTML(Request("emailBody")) 'Set To Email address emailTo = pEmailSales 'Did the user click the "Send" button? if Request.Form("formID") = "00" then 'Do some checks if len(emailName) = 0 then arrayErrors = arrayErrors & "|emailName" end if if len(emailFrom) = 0 then arrayErrors = arrayErrors & "|emailFrom" else if inStr(emailFrom,"@") = 0 or inStr(emailFrom,".") = 0 then arrayErrors = arrayErrors & "|emailFrom" end if if invalidChar(emailFrom,1,"@.-_") then arrayErrors = arrayErrors & "|emailFrom" end if end if if len(emailSubject) = 0 then arrayErrors = arrayErrors & "|emailSubject" end if if len(emailBody) = 0 then arrayErrors = arrayErrors & "|emailBody" end if 'If there was no errors, send the email. if len(trim(arrayErrors)) = 0 then 'Send Email call sendmail (emailName, emailFrom, emailTo, emailSubject, emailBody, 0) 'Say Thank You response.redirect "sysMsg.asp?msg=" & server.URLEncode(langGenContactUsMsg) end if end if %> <% 'Close Database Connection call closedb() '********************************************************************** 'Main Shopping Cart Display Area. '********************************************************************** sub cartMain() %>
<%=langGenContactUsHdr%>

<% 'If there were errors, show message if len(trim(arrayErrors)) > 0 then arrayErrors = split(LCase(arrayErrors),"|") Response.Write "" & langErrInvForm & "

" else arrayErrors = array("") end if %> <%=langGenTo%> : <%=emailTo%>

<%=langGenYourName & " " & checkFieldError("emailName",arrayErrors)%>

<%=langGenEMail & " " & checkFieldError("emailFrom",arrayErrors)%>

<%=langGenSubject & " " & checkFieldError("emailSubject",arrayErrors)%>

<%=langGenMessage & " " & checkFieldError("emailBody",arrayErrors)%>



<% end sub %>