<%@ 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 dim telefone '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")) telefone = validHTML(Request("telefone")) 'Set To Email address emailTo = pCompany & "

" & pCompanyAddr '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(telefone) = 0 then arrayErrors = arrayErrors & "|telefone" 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, pEmailSales, emailSubject & " - Telefone para contato: " & telefone, 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)%>

<%=langGenPhone & " " & checkFieldError("Telefone",arrayErrors)%>

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

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

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



<% end sub %>