Blocking Spam With Javascript

Started by Forum-Engine, October 07, 2011, 12:42:49 PM

Forum-Engine

Hi all,

Coder Will Bontrager (willmaster.com) shared this spam busting tip with me, and I thought you might find it useful.

---------------

One of the easiest form spam reduction techniques is to put a URL in the form's action tag that goes to a regular page instead of the form handling script - a real page, not a 404, so spammers don't get notified to manually investigate your code.

Somewhere below the form, JavaScript assigns the correct URL to the action tag.

The form tag needs an id value for the JavaScript to use. Example:

<form id="handle" action="/index.html"> ... </form>

<script type="text/javascript"> document.getElementById("handle").action = "/script.php"; </script>

Spammers' robots seldom parse JavaScript, so their automated submission never reaches the form handler specified by the JavaScript.

Instead, their spam goes poof at the URL hard coded into the form tag.
Use this coupon code "u5ObBNO8" to get our viral
link building tool
for free.