I have a simple Classic ASP feedback form that suffers from SPAM. All code is client side and I believe the idea is to hide the email address from the BOTS. While I understand the honeypot concept in principle, I'm not understanding how to adapt the code below to accomplish this. Hoping for an relatively easy fix without having to modify extensively. Any help appreciated...
<%
ErrorStatus = 0
ErrorMessage = ""
If Trim(Request("comment")) + "" = "" Then
ErrorStatus = 1
ErrorMessage = "Please provide a non-blank comment"
ElseIf Request("name") + "" = "" Then
ErrorStatus = 2
ErrorMessage = "Please provide a non-blank name"
ElseIf Trim(Request("email")) + "" = "" Then
ErrorStatus = 3
ErrorMessage = "Please provide a non-blank e-mail address"
ElseIf Trim(Request("email")) & "" <> "" and InStr(Request("email"),chr(64)) = 0 Then
ErrorStatus = 4
ErrorMessage = "Please enter a valid e-mail address"
End If
If ErrorStatus > 0 Then %>
<form action="feedback.asp" method="post">
<input type="hidden" name="action" value="send">
<br>
<FONT FACE="Arial, Helvetica, Verdana" COLOR="red"><b><DIV CLASS="h1"> * <%= ErrorMessage %> *</DIV></b></FONT>
<br>
<FONT FACE="Arial, Helvetica, Verdana" COLOR="gainsboro">
<DIV CLASS="h2_30">
<p>Your Name:
<br>
<input name="name" size=35 value="<%= Request("name")%>">
<p>Your E-Mail Address:
<br>
<input name="email" size=35 value="<%= Request("email")%>">
<p>Your Comments:
<br>
<textarea name="comment" cols=50 rows=7><%= Request("comment") %></textarea>
<p><input type="submit" value="Send Mail">
</FONT>
</DIV>
<br>
<DIR>
<FONT FACE="Arial, Helvetica, Verdana" COLOR="#ffd700">
<DIV CLASS="h3">
<b>* All fields required</b>
</DIV>
</FONT>
</DIR>
</form>
<% Else
strBody = Request("comment") & Chr(13) & Chr(10) & Chr(13) & Chr(10)
strBody = strBody & Request("name") & Chr(13) & Chr(10) & Request("email") & Chr(13) & Chr(10)
Set objMessage = CreateObject("CDO.Message")
objMessage.Sender = Request("name")
objMessage.From = Request("email")
objMessage.TextBody = strBody
objMessage.To = "email@email.com"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
On Error Resume Next
objMessage.Send
Response.Write "<BR><FONT FACE=Arial, Helvetica, Verdana COLOR=gainsboro><DIV CLASS=h2_10B><DIV CLASS=h2_10B><DIV CLASS=h2_10B><p>Feedback Sent!</p></DIV></DIV></DIV></FONT>"
set objMessage = nothing
End If %>
<% End Sub %>
<% Sub GetInfo %>