ArticleCoop.com homepage.
Follow Us On Twitter
Translate Page To Irish Translate Page To German Translate Page To Spanish Translate Page To French
Translate Page To Italian Translate Page To Japanese Translate Page To Korean Translate Page To Portugese Translate Page To Chinese
  Number Of Times Read: 5      
Categories

Accessories (1678)
Advice (2174)
Aging (363)
Arts (10183)
Arts and Crafts (987)
Automotive (8081)
Break-up (248)
Business (82725)
Business Management (1447)
Cancer Survival (400)
Career (511)
Cars and Trucks (5580)
CGI (7)
Cheating (259)
Coding Sites (185)
Computers (18891)
Computers and Technology (9292)
Cooking (2350)
Crafts (748)
Culture (280)
Current Affairs (1080)
Databases (79)
Death (60)
Education (12186)
Entertainment (14643)
Etiquette (21)
Family Concerns (2442)
Film (89)
Finances (30013)
Food and Drinks (5698)
Gardening (2548)
Healthy Living (44392)
Holidays (1016)
Home (15010)
Home Management (1925)
Internet (43932)
Jobs (1172)
Leadership (108)
Legal (1390)
Medical (2163)
Medical Business (196)
Medicines and Remedies (2018)
Men Only (3149)
Motorcyles (167)
Opinions (48)
Our Pets (5178)
Outdoors (1850)
Parenting (1033)
Pets (597)
Recreation (1239)
Relationships (12013)
Religion (2142)
Science (396)
Self Help (1174)
Self Improvement (4903)
Society (922)
Sports (9722)
Staying Fit (13131)
Technology (8102)
Travel (11120)
Web Design (2106)
Weddings (1250)
Wellness, Fitness and Di (5750)
Women Only (8261)
Womens Interest (1465)
World Affairs (47)
Writing (2296)
 
Stats
Total Articles: 4
Total Authors: 103724
Total Downloads: 6552117


Newest Member
Georgiana Serrano

 


   

3 Ways to Stop Form and Comment Spam in Their Tracks



[Valid RSS feed]  Category Rss Feed - http://www.articlecoop.com/rss.php?rss=94

[Valid RSS feed]  Kurt Hartman's Author Feed - http://www.articlecoop.com/author-rss-feed.php?rss=5838
By : Kurt Hartman    4 or more times read
Submitted 2011-07-17 00:30:00
If you run a website, then it is a given that you have some sort of built in contact form for your users. Maybe you even want to give them a login of some sort, or allow comments on your blog.

It s a natural usability feature that should be built in. After all, the web was made for interaction between people. That being said, running a website comes with the obvious problem of webbot generated, spammy emails.

My biggest annoyance as a developer is the garbled text and links that these little babies send out. Guess what? When the stupid bots figure out how to fill out the forms, they send even more.

Such was the case, this week. My website was attacked by spam bots, which resubmitted the same form every 3 minutes, and flooded my inbox with garbage, as well as those of my co labourers.

Now, this particular form was not my standard Drupal form. It was one that I thought had sufficient validation parameters to keep me from getting that kind of garbage.

Evidently, I failed. So, I began researching my options from preventing a hideous amount of spam from reaching me, and I thought I would share the three most common/best solutions that I found, along with their caveats.

1. CAPTCHA: This stands for Completely Automated Turing Honestly, who cares what it stands for, I hate em. Those little Type the words from this picture in the box deals that are on every website.

The good news, for the most part, is that they work. I think these are fine for preventing robot creation of usernames and profiles for spam purposes. For larger sites, this may be the only option available.

If you are using it for a business contact form, it could very well frustrate your users, and you could lose sales as a result.

Pros: Works very well at keeping spam bots away. Great for large sites.

Cons: Works well for keeping humans away.

2. Ajax Forms: How do you fill out a form that is not there? It sounds like some kind of Buddhist proverb. Yet, that is the concept behind Ajax forms. Now, it has to be a certain kind of form to work.

First off, the fields have to load as you fill them out. Fill out one field, tab to the next, the field becomes active. Since bots don t do well with javascript, and try to fill out all the fields at once, this creates a problem for them.

Honestly, I considered using this type of form, but did not use it, for two reasons:

a. What if someone has javascript disabled? No form. If you have a form with graceful degradation to HTML, then you end up with the same problem you had before: the bots can fill it out.

b. I m not particularly comfortable with Ajax y stuff. Sorry.

Pros: Works like a charm.

Cons: Problems for mobile users, and people without javascript enabled.

3. The Hidden Field

This was the method that I stumbled across, which was the easiest to implement, and created very few problems for human users.

The key is to add a hidden field, and make it empty as the default(most fields are..heheh). Then, add either inline css to the text area, so that it does not show up for human users. That code would be style= display: none; for those of you who want the quick version.

In your validation (this is for PHP style form processor), do something like this for the hidden field:

$hidden = Trim(stripslashes($_POST[ message]));

Then, check to see if the variable is still empty, using validation. If it is, allow the message to go through. A human submitted it, most likely.

If not, the bot has done its mindless job of filling out every field it finds with data, and should be redirected to an error page.

Once it is unsuccessful a few times, the bot will give up, and go hassle someone else, for once.

Pros: Easy to implement. User never sees anything unexpected.

Cons: You must know a minimum of PHP to implement. User must have CSS enabled.

Hopefully, you found this little article interesting and helpful. In parting, may all your webspam issues, be small webspam issues.

One more thing: The fear of the Lord is the beginning of wisdom. No one who puts their hope in Him will ever be ashamed.
Author Resource: Kurt Hartman is Head of Web Development for a company that sells heavy equipment and OTR Tires at http://www.otrtiresupply.com . He hates spam bots, and so should you.
Article From ArticleCoop

Related Articles

HTML Ready Article. Click on the "Copy" button to copy into your clipboard.




Firefox users please select/copy/paste as usual
Rate This Article
Vote to see the results!

Do you like this article?
  • Yes.
  • Not Sure.
  • No.


New Members
select
Sign up
select
Learn More
 
Nav Menu
Home
Login
Submit Articles
Submission Guidelines
Top Articles
Link Directory
About Us
Contact Us
Privacy Policy
RSS Feeds

Actions
Print This Article
Add To Favorites

 
Sponsors


5% off CoffeeForLess.com Code: CFL

 


Copyright © 2009 - ArticleCoop.com
All Rights Reserved.

Powered By:Article Friendly