Internet Marketing Forum

Internet Marketing Forum


For Webmasters and Entrepreneurs
GoDaddy.com Hosting just $1.99/mo! - 468x60
|
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 07:06:28 PM

Login with username, password and session length

Whoever undertakes to set himself up as a judge of Truth and Knowledge is shipwrecked by the laughter of the gods.


- Albert Einstein

|-   Internet Marketing Forum > Online Business Discussions > Website Design and Maintenance > Programming
+  

Blocking Spam With Javascript

0 Members and 1 Guest are viewing this topic.
Pages: [1] Reply to Thread
Author Topic: Blocking Spam With Javascript  (Read 257 times)
OfflinePhil Tanny
Beginner
Phil Tanny is on a distinguished road
Joined: Oct 2011
Posts: 12


Avatar of Phil Tanny

View Phil Tanny\s ProfileWWW
United States
notepad Oct 08, 2011, 06:35:19 PM #1
Hi all,

Expert coder Will Bontrager  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.

Free Viral Link Building Tool: Use this coupon code "u5ObBNO8" to get our viral link building tool for free. It's simple, effective, totally white hat, and if you get it now, free as well. Click here.
Offlineronfrank
Senior Member
ronfrank is on a distinguished road
Joined: Mar 2008
Posts: 285


Avatar of ronfrank

View ronfrank\s Profile
Gender: MaleAries United States
notepad Oct 08, 2011, 11:28:57 PM #2
That's an excellent idea.

I didn't know you could manipulate the form action via javascript.

I guess you would use the onload method to call the script to change the action url?


Summer Savings! $7.49 .com domains at GoDaddy.com!
Pages: [1] Reply to Thread


Code4Gold Internet Marketing Forum © 2006-2011 Resdaz Media LLC - All Rights Reserved
Forum Software Powered by SMF - © 2001-2008, Lewis Media. All Rights Reserved.