besnette1
Technical User
- Jun 19, 2001
- 9
Hello,
I am learning CF, so it this is a lame question, I apologize.
I am trying to make my simple contact form less easy for comment spammers. A friend suggested to put a math problem in there that has to be correct. I have been trying, and I think/hope I am close, but it isn't re-directing to my error page when the wrong answer is entered. If anyone can see what I might be doing wrong with my code below, I would be most grateful.
I hope everyone is having a wonderful day!
Basically the code is:
<form action="cfmmailto10.cfm" method="post" name="form1">
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="comments" cols="35" rows="4">Type comments here</textarea>
</font> <font size="2" face="Verdana, Arial"> <br>
<input name="name" type="text" value="your name" size="35">
</font><br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="emailaddress" type="text" value="your e-mail (required)" size="35">
</font><br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
What is 2 + 5? I want to make sure you are a human:
<cfset answer= 7>
<cfif answer EQ 7>
<input name="answer" type="text" value="?" size="3">
</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="Submit" type="submit" value="Send it">
</font> </p>
<cfelse>
<cflocation url="(I'll put my site error url here)">
</cfif>
</form>
I am learning CF, so it this is a lame question, I apologize.
I am trying to make my simple contact form less easy for comment spammers. A friend suggested to put a math problem in there that has to be correct. I have been trying, and I think/hope I am close, but it isn't re-directing to my error page when the wrong answer is entered. If anyone can see what I might be doing wrong with my code below, I would be most grateful.
I hope everyone is having a wonderful day!
Basically the code is:
<form action="cfmmailto10.cfm" method="post" name="form1">
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="comments" cols="35" rows="4">Type comments here</textarea>
</font> <font size="2" face="Verdana, Arial"> <br>
<input name="name" type="text" value="your name" size="35">
</font><br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="emailaddress" type="text" value="your e-mail (required)" size="35">
</font><br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
What is 2 + 5? I want to make sure you are a human:
<cfset answer= 7>
<cfif answer EQ 7>
<input name="answer" type="text" value="?" size="3">
</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="Submit" type="submit" value="Send it">
</font> </p>
<cfelse>
<cflocation url="(I'll put my site error url here)">
</cfif>
</form>