Where your journey begins
Antons Video ProductionsNetObjects Fusion 7 Websites Portal



Adding A Honey Pot To Block Form Spamers

A honey pot is a trap that most of the form spam-bots will fall into because they just can't resist. It is made up of 3 parts. First is a css definition that will make the display invisable on the page. The second is a form field that must be left blank or the form does not process. The third part is some conditional processing that will not send an email if the hidden field is filled in. Since all form spam-bots are blind (i.e. they only read the raw html code and can not see what is viable to the web site visitor), when they see a form input box named URL or EMAIL they just have to stick their spam links in there. Once they do that, they show that the form was filled in by a bot and not by a real person because the URL field is invisible to a real person. Once we know the form was filled in by a bot, we can do some conditional processing and only send an email if it was filled in by real people.

To use this spam block you would create a form using Fusion's standard Form Tools. A simple form would consist of a name field (visitName) an email field (visitAd) and a comments field (comments). It is always a good idea to avoid using a name such as email or email-address as bots look for anything with email or url in it. In this example I have used visitAd (for visitor's address)

Before you begin you need to have a fully functioning form. You need to know before you start that your form works so that if there are any problems they will be with the honey pot and not something to do with your normal form processing. The insertion of the input field which uses the hidden css code we will create assumes that you have your form completed and tested (i.e. insert the honey pot into a known working form so that if you have problems you will know that the form worked BEFORE you made these changes to it).

Step 1 Create A Hidden CSS Definition

From the menu click text, then manage stylesFirst we will need to create a CSS class to hold our hidden definition

On the page that contains your form from the menu bar click Text, then from the drop down, select Manage Styles

  1. Click the New button in the lower left corner of the Manage Styles properties palette
  2. In the Style Type area click the Radio Button Create Custom Style
  3. Name the style hideField (one word with a capital F in the middle)
  4. In the Style Scope area select Page Specific

Create the style outline

When you click OK the Text Format properties palette will open up

  1. Click the Custom Tab
  2. Click the New button
  3. In the Attributes Properties for Name enter display
  4. For Value enter none
  5. Click OK

Enter Custom CSS

Step 2 Insert the Invisible URL Input Field
  1. On your form, click on the email address input box to bring up the Form Edit Field properties palette
  2. Click on the HTML button
  3. On the first line of the Object HTML insertion dialog box paste this block of code

    <div class="hideField"><input type="text" name="url" value=""></div>

    Remember how we said form-bots can't resist a URL input field?

Insert Hidden input field

Now that we have caught our form spam-bot we need to tell the processing page to throw away any forms that are submitted that have any content entered in the URL field. Only a form spam-bot will see the URL field and since they only want to spread links to other spam sites they will always make an entry into any field that says URL

Step 3 Do Conditional Processing To Stop Bots
  1. Go to your forms processing page
  2. Press F9 to bring up the Layout Properties palette
  3. Press the HTML button
  4. On the first line enter your conditional processing to skip sending the email if there is anything in the URL field

In ColdFusion this would be

<cfif #form.url# EQ "">
cfmail coding goes in between the cfif and /cfif statements

Insert your contiditonal processing code on the first line of code

The Thank You html page will display for everyone so even the form spam-bot will think that they have been successful with their attempt to send you a link that tells you how you can enlarger your...... Only the input from a live web site visitors (who cannot see the URL field and leave it blank) will have their form processed and an email sent

Return to the TOP of this page

Did you find this tutorial useful?
Do you want to keep this resource online?
Make a donation to keep gotFusion alive

|  Fusion  |  Web Design  |  Hosting  |  Resources  |  gotFusion Store  | 

Problems with this page?  

All content copyright © 2001 - 2017 gotFusion LLC. The name gotFusion and the gotFusion ® logo are registered trademarks of gotFusion LLC
Copyright, legal notice & privacy statement