%@ Language=VBScript %>
<% 'Option Explicit %>
<%
Dim Title, Description, onload, header, script_name, onunload
session.timeout = 60
Title = "Contact Us"
Description = "Use this form to send us an email."
'header = "Contact Us"
SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")
' '
sMsg = Request.QueryString("msg")
' '
onload = "initialize();"
onunload = "GUnload();"
CompanyName = application("company_name")
'Response.Write "Company Name: " & CompanyName & "
"
ToAddress = application("driving_directions_address") & ", " & application("driving_directions_zip")
'Response.Write "Address/Zip: " & ToAddress & "
"
ToLat = application("driving_directions_marker_lat")
'Response.Write "To lat: " & ToLat & "
"
ToLng = application("driving_directions_marker_lng")
'Response.Write "To Long: " & ToLng & "
"
centerLat = application("driving_directions_center_lat")
'Response.Write "Center Lat: " & centerLat & "
"
centerLng = application("driving_directions_center_lng")
'Response.Write "Center Long: " & centerLng & "
"
DefaultZoom = application("driving_directions_default_zoom")
'Response.Write "Default Zoom: " & DefaultZoom & "
")
'Biznetix.net Key
'Google_API_Key = "ABQIAAAA5Qq3QT_oytdrZZpF_GMIHBRjD7mgFQ9CvZlrmX8K_e1l3eRLNBSviK2_dDAs6hfh8L--a3zCPb4fXw"
Google_API_Key = Application("Google_API_KEY")
sMarkerAddress = application("driving_directions_address") & "
" & application("driving_directions_city") & "," & application("driving_directions_state") & " " & application("driving_directions_zip")
sMarkerPhone = application("driving_directions_phone")
const table_name = "Contact_Submissions"
const field_list = "theirname,email,phone,comments"
const one_second = 1.1574074074074074074074074074074e-5
const seconds_timeout = 10
if application("reCaptcha_on") then
publickey = "6LcbYAQAAAAAAD3K7lv05XjEuL1rJ8WfMYu3xVDK"
privatekey = "6LcbYAQAAAAAABhhErHGPxXgaXkKXrVvhLIK0z44"
end if
%>
<%
header = "Contact Us"
%>
<%
If CheckPost() then
' '
'recaptcha check
if application("reCaptcha_on") then
recaptcha_challenge_field = request.form ("recaptcha_challenge_field")
recaptcha_response_field = request.form("recaptcha_response_field")
confirm = recaptcha_confirm(privatekey, recaptcha_challenge_field, recaptcha_response_field)
if confirm <> "" then
response.redirect SCRIPT_NAME
end if
end if
If Session("anti-spam-message-id") = "" then
Response.Redirect Script_Name
End If
' '
on error resume next
'anti form spam
if (request.form(Session("anti-spam-message-id-var")) = Session("anti-spam-message-id")) and ((now() - dateSafe(Session("anti-spam-time")))>seconds_timeout*one_second ) then
on error goto 0
sName = Left(sqlSafe(Request.form("theirname")),255)
sEmail = Left(sqlSafe(Request.form("email")),255)
sComments = sqlSafe(Request.form("comments"))
If sName <> "" and sEmail <> "" and sComments <> "" then
'add email to database
dim strSQL, rsAddMail
strSQL = "SELECT * FROM " & table_name & ";"
Set rsAddMail = Server.CreateObject("ADODB.Recordset")
rsAddMail.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
rsAddMail.AddNew
dim f
for each f in split(field_list,",")
rsAddMail.Fields(f).Value = Left(Request.form(f),255)
next
rsAddMail.Fields("searchEngine").Value = Left(Session("search_engine"),255)
rsAddMail.Fields("searchPhrase").Value = Left(Session("search_phrase"),255)
rsAddMail.Update
rsAddMail.Close
'send email
Dim msg, email_from, email_to, subject, cc, bcc, to_txt, from_txt, err_msg
email_from = replace(Request.form("email"),vbcrlf,"")
'email_to = "developers@biznetix.net"
email_to = "tony@ccmiplastics.com"
'email_to = "edk@fltg.net"
subject = "Contact Form Submitted on " & request.servervariables("SERVER_NAME")
cc = ""
bcc = ""
to_txt = email_to
from_txt = "Web server: " & request.servervariables("SERVER_NAME")
msg = ""
for each f in split(field_list,",")
msg = msg & f & ": " & Request.form(f) & vbcrlf
next
msg = msg & "Remote IP: " & Request.ServerVariables("REMOTE_ADDR") & vbcrlf
msg = msg & "Search Engine: " & Session("search_engine") & vbcrlf
msg = msg & "Search Phrase: " & Session("search_phrase")
send_text_email email_to, email_from, cc, bcc, to_txt, from_txt, subject, msg, err_msg
' '
'Redirect to thank you page
Response.Redirect "/contact_thankyou.asp"
Else
sErrMsg = "There was an error processing your request. Please ensure all required fields are complete."
Response.Redirect Script_Name & "?msg=" & sErrMsg
End If
%>
<% else ' form is being spammed %>
Your submission was not accepted as it appears to be spam. Unfortunately, due to new anti-spam measures, you must enable cookies and javascript to submit to our forms.
<%'="A:" & Session("anti-spam-message-id-var") & "
"%>
<%'="B:" & request.form(Session("anti-spam-message-id-var")) & "
"%>
<%'="C:" & Session("anti-spam-message-id") & "
"%>
<%'="D:" & now() - cdate(Session("anti-spam-time")) & "
" %>
<%'="E:" & NOW() & "
" %>
<%'="F:" & cdate(Session("anti-spam-time")) & "
" %>
<% end if %>
<%
'Destroy session variables so that you must return to previous screen before resubmitting
Session("anti-spam-message-id") = ""
Session("anti-spam-message-id-var") = ""
Session("anti-spam-time") = "" %>
<% Else %>
<%End if%>