%
'get destination
destination0 = "publicationdownloads.htm"
destination1 = "publicationdownloads2.htm"
select Case Request.QueryString("dest")
Case 1
dest = destination1
Case Else
dest = destination0
End Select
CookieDate = LCase(Request.Cookies("AUTH"))
If CookieDate <> "" Then
Response.Redirect (dest)
End If
Function logTrans()
Dim i
Dim objRS
Dim strQueryString
Dim strForm
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open "tblLog", strConnect, adOpenKeyset, adLockOptimistic
objRS.AddNew()
objRS("UserID") = Session("UserID")
objRS("CreationDate") = Now()
For i = 1 To Request.QueryString.Count
strQueryString = strQueryString & "*" & Request.QueryString.Key(i) & "=" & Request.QueryString.Item(i)
Next
objRS("Query_String") = strQueryString
For i = 1 To Request.Form.Count
strForm = strForm & "*" & Request.Form.Key(i) & "=" & Request.Form.Item(i)
Next
objRS("Post_String") = strForm
objRS("Dest") = Session.Contents("destURL")
objRS.Update()
objRS.Close()
End Function
Function Add_tblContact()
Dim objtblContact
Dim errtblContact
Set objtblContact = Server.CreateObject("ADODB.Recordset")
errtblContact = ""
objtblContact.open "tblContact", strConnect, adOpenKeyset, adLockOptimistic
objtblContact.AddNew
If Request.Form("email") <> "" Then
objtblContact("email") = Request.Form("email")
Else
errtblContact = errtblContact & "email is a required field "
End If
If Request.Form("first_name") <> "" Then
objtblContact("first_name") = Request.Form("first_name")
Else
errtblContact = errtblContact & "first_name is a required field "
End If
If Request.Form("last_name") <> "" Then
objtblContact("last_name") = Request.Form("last_name")
Else
errtblContact = errtblContact & "last_name is a required field "
End If
If Request.Form("company_name") <> "" Then
objtblContact("company_name") = Request.Form("company_name")
Else
errtblContact = errtblContact & "company_name is a required field "
End If
If Request.Form("job_title") <> "" Then
objtblContact("job_title") = Request.Form("job_title")
Else
errtblContact = errtblContact & "job_title is a required field "
End If
If Request.Form("street_address_1") <> "" Then
objtblContact("street_address_1") = Request.Form("street_address_1")
Else
'errtblContact = errtblContact & "street_address_1 is a required field "
End If
If Request.Form("street_address_2") <> "" Then
objtblContact("street_address_2") = Request.Form("street_address_2")
Else
'errtblContact = errtblContact & "street_address_2 is a required field "
End If
If Request.Form("city") <> "" Then
objtblContact("city") = Request.Form("city")
Else
'errtblContact = errtblContact & "city is a required field "
End If
If Request.Form("state") <> "" Then
objtblContact("state") = Request.Form("state")
Else
' errtblContact = errtblContact & "state is a required field "
End If
If Request.Form("zip_code") <> "" Then
objtblContact("zip_code") = Request.Form("zip_code")
Else
' errtblContact = errtblContact & "zip_code is a required field "
End If
If Request.Form("phone") <> "" Then
objtblContact("phone") = Request.Form("phone")
Else
errtblContact = errtblContact & "phone is a required field "
End If
If Request.Form("fax") <> "" Then
objtblContact("fax") = Request.Form("fax")
Else
'errtblContact = errtblContact & "fax is a required field "
End If
If Request.Form("primary_business") <> "" Then
objtblContact("primary_business") = Request.Form("primary_business")
Else
errtblContact = errtblContact & "primary_business is a required field "
End If
If Request.Form("total_employees") <> "" Then
objtblContact("total_employees") = Request.Form("total_employees")
Else
'errtblContact = errtblContact & "total_employees is a required field "
End If
If Request.Form("branding") = "ON" Then
objtblContact("branding") = True
Else
objtblContact("branding") = False
'errtblContact = errtblContact & "branding requires a yes or no selection "
End If
If Request.Form("advertising") = "ON" Then
objtblContact("advertising") = True
Else
objtblContact("advertising") = False
'errtblContact = errtblContact & "advertising requires a yes or no selection "
End If
If Request.Form("direct_marketing") = "ON" Then
objtblContact("direct_marketing") = True
Else
objtblContact("direct_marketing") = False
' errtblContact = errtblContact & "direct_marketing requires a yes or no selection "
End If
If Request.Form("recieve_updates") = "ON" Then
objtblContact("recieve_updates") = True
Else
objtblContact("recieve_updates") = False
' errtblContact = errtblContact & "recieve_updates requires a yes or no selection "
End If
If errtblContact = "" Then
objtblContact.Update
objtblContact.Close
Call logTrans
'send Reply
notifyMessage = "A visitor to Front-EndFocus.com has filled out the Contact Information form." & vbnewLine & vbNewline & "To download the Excel file containing all the visitor information click here http://www.frontendfocus.com/clientlist.asp."
replyMessage = "You are receiving this email because your email address was used to fill out a form on the Front-End Focus web site." & vbNewline & vbNewLine & "Thank you for visiting the Front-End Focus web site. We hope you have found the merchandising information on the site useful. We continually update the site with useful news and information so please check back often. A representative from Front-End Focus will contact you shortly." & vbNewline & vbNewLine & "Bookmark this link to have direct future access to the downloads page http://www.front-endfocus.com/publicationdownloads.htm" & vbNewline & vbNewLine & "Sincerely," & vbNewline & vbNewLine & "Front-End Focus" & vbNewline & vbNewLine & "This email is a one-time notice. If this email has reached you in error please delete it or email your concerns to remove@front-endfocus.com"
If Request.Form("branding") = "ON" Or Request.Form("advertising") = "ON" Or Request.Form("direct_marketing") = "ON" Then
errtblContact = errtblContact & sendMail(Request.Form("First_Name") & " " & Request.Form("Last_Name"), Request.Form("email"), replyMessage)
End If
'Call sendMail("Andy McCabe", "andy@rescueworld.com", "There has been an addition to the database at Front End Focus. Go to http://www.frontendfocus.com/site/contactsveiw.asp to veiw or download the data.")
'send info
errtblContact = errtblContact & sendMail("Rod Brown", "rbrown@dechert-hampe.com", notifyMessage)
errtblContact = errtblContact & sendMail("David Joslin", "joslin@mosswarner.com", notifyMessage)
ExpirationLength = 30
Response.Cookies("AUTH") = Date
Response.Cookies("AUTH").Expires = DateAdd("d", ExpirationLength, Date)
Response.Redirect dest
Else
Response.Write errtblContact
End If
End Function
Function sendMail(eName, eMail, message)
If eName = "" Then
eName = eMail
End If
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Front-End Focus"
' Mailer.FromAddress= "support@mosswarner.com"
Mailer.FromAddress= "support@front-endfocus.com"
' Mailer.RemoteHost = "mail.mosswarner.com"
' Mailer.RemoteHost = "mail.front-endfocus.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient eName, eMail
Mailer.Subject = "Contact Information Form"
Mailer.BodyText = Message
if Not Mailer.SendMail then
sendMail = Mailer.Response
end if
' if Mailer.SendMail then
' Response.Write "Mail sent..."
' else
' Response.Write "Mail send failure. Error was " & Mailer.Response
' end if
End Function
%>
Front-End Focus
<%
If Request.Form("b1") = "Submit" Then
Call Add_tblContact
End If %>