Sales and Marketing TechnologiesFor Orlando web design services Call 407.682.2222
Search
Do you want Breakthrough Results? Let us help you.Click to boost online marketing results
Click to boost online marketing results! Click to sign up for our FREE e-Newsletter
Web Development Custom Web Development E-commerce Solutions Web Consulting Web Maintenance Web Hosting CMS Solutions
Internet Marketing Internet Marketing Consulting Local Search Marketing Pay Per Click Management Reputation Management SEO Services Social Networking Video SEO (VSEO)
Case Studies Miami Children's Hospital Reflectx Services Dinnerware Depot U.S. Home Filter
About SMT Altamonte Springs Office
Internet Marketing Blog Contact Us Refer a Client Employment
Blog

Reduce SPAM without CAPTCHA using a CustomValidator

5/18/2010
Bookmark and Share

There are plenty of resources and methods out there you can use to reduce the amount of submissions to a form on your website by non-humans.  Some website administrators get hundreds or thousands of submissions from bogus people.  They are often automated bots searching for open holes your website to infuse content for whatever their purpose is.  Many times it is to promote their own website, content, or services. Sometimes they are attempts to cause the website or webserver to crash, inject viruses or spread maliciousness to anyone using the internet. Often there is intent to spread porn traffic. 

One person asked me, “Why would someone do that?”  I answered, “The same reason people create world-wide system-debilitating viruses.  Usually, the reason is ‘cause they can’.”

I received comments from a blog post I wrote recently, Optimizing Search Engine PageRanking by Using Dynamic 301 Redirects .  After I weeded out the porn site submissions and cross site linking,  I was honored by some of the comments, like “A very useful info. thanks” and “like this information good work thanks”.  Then I realized they were all over the place, by different bogus people.  Oh well.

A popular tool developers have used to prevent automated systems from making automated hits to a form is CAPTCHA.  Here is more information about CAPTCHA, because I don’t intend on covering this tool in detail CAPTCHA: Telling Humans and Computers Apart Automatically.

The advantages of CAPTCHA is that the regular internet is used to going through this security check on forms all over the internet.  This is also a disadvantage because it is really annoying.  Another advantage to CAPTCHA is that it is easy to implement and very little code.  You can see problems when you use CAPTCHA on an SSL secure page, as this control may not be secure.  Another disadvantage is that SPAM programs get smarter and smarter and have learned how to get past that roadblock.  They “kick over the pebble” and SPAM the form anyway.

I have an alternative approach.  Try creating a timer to your form that doesn’t allow submissions before a set amount of time. 

The first thing you do is add a server side textbox.  Set the visible property to false.
 

    <asp:TextBox runat="server" ID="txtStartTime" Visible="false"></asp:TextBox>

 
Secondly, add a custom validator for the text box above. 

     <asp:CustomValidator runat="server" ID="countSeconds" ControlToValidate="txtStartTime" OnServerValidate="CheckSeconds" ErrorMessage="Please try your submission again."> </asp:CustomValidator>

Next, set the time when the page is loaded, on Page_Load.
 

    protected void Page_Load(object sender, EventArgs e)

    {

        if (!IsPostBack)

        {

            txtStartTime.Text = DateTime.Now.ToString();

        }

    }

 
Then add the OnServerValidate method.  This method checks to see if the current time is greater then <n> seconds from the start time on Page_Load.  Then the Page.IsValid is true or false based on the time difference you’ve pre-set.  In my example, I set the time to 10 seconds.
 

    protected void CheckSeconds(object sender, ServerValidateEventArgs args)

    {

        DateTime startDate = Convert.ToDateTime(txtStartTime.Text);

        if (DateTime.Now > startDate.AddSeconds(10))

            args.IsValid = true;

        else

            args.IsValid = false;

    }

 
Before the data from the form is saved, first check that the Page.IsValid is true.

    protected void btnSubmit_Click(object sender, EventArgs args)

    {

        if (Page.IsValid)

        {

            //Your save data here...

            SaveData();

        }

    }

In conclusion, we require the “human” to spend at least 10 seconds on the page before submitting the form.  If the form is submitted before 10 seconds, the user gets a message “Please try your submission again.”  The average contact form probably takes at least 30 seconds or more to complete.  Adjust the time accordingly for more protection. Like anything out there, it may not be foolproof, but it is an alternate. 

I hope you have better luck getting value added leads and information from real human beings.

Joanna Smith 5/18/2010

Add your comments:

Items in bold indicate required information.

Name :
 
Email :
 
Comments :
 
 
Latest Posts

Categories
Blogging (2)
Google (3)
Local (2)
Website Design (4)
Website Functionality (5)
Internet Marketing (90)
Company News (6)
Email Marketing (7)
General Marketing (11)
Google Android (2)
Local Search (12)
Mobile Search (2)
Offline Marketing (2)
PPC (13)
RSS (5)
Search Engine Optimization (36)
Social Media (9)
Social Networking (18)
General Programming (2)
SQL Programming (2)
Video Search Engine Optimization (3)

Archives

Blogroll
Melbourne Web Design
Orlando Search Marketing
Lakeland Web Design
ASP.NET CMS

Feeds



Newsletter Signup
Enter your email address below and receive special offers.
From Our Customers
“SMT’s Internet Marketing team has consistently increased year-over-year sales for eight straight years. I cannot say enough nice things about SMT.”

Scott Fulton, Owner, Dinnerware Depot, Inc.
Our Work    |    Web Development    |    Internet Marketing    |    Case Studies    |    FAQ    |    About SMT    |    Press Room
Employment    |    Refer a Client    |    Contact Us    |    Internet Marketing Blog    |    Privacy Policy    |    Site Map

Sales & Marketing Technologies
Altamonte Springs: 220 E. Central Parkway, Suite 1010 • Altamonte Springs, FL 32701407-682-2222

© 2011, Sales & Marketing Technologies, Ltd. All rights reserved.
Website Design FL & Search Engine Optimization Services