Do you want to stop spammers from harvesting the email address you use on your website?

If you want your viewers to be able to contact you, then you must have a "mailto" link containing your email address on your web pages.

But this causes a big problem: spammers want your email address. So they send out a robot with the mission of finding and capturing all the addresses it can. This is done by examining the HTML code used by browsers to render each webpage. All the bot has to do is save the email address it finds in your "mailto" link.

The old-school methods for "hiding" an email address:

* Munging. In this technique, the viewer must type in the address to send an email to the website. That's because real words are used instead of the usual symbols. Example: harold AT aol DOT com

* Encoding. The simplest way to do this is to use the standard ASCII coding to replace each letter or symbol in the address with its ASCII code. For example, the simple email address a @ b.com would look like:

& #97; & #64; & #98; & #46; & #99; & #111; & #109; ( spaces were added to prevent the browser from printing the letters )

The "mailto:" link can still be used, because the browser will recognize the code and print out the real email address on the page.

The methods shown above are no longer viable.

These methods may have worked when they were first introduced, but one should never underestimate the intelligence of the hackers who program the spambots. There are new bots that can decode both of these email encryption techniques.

These two methods by no means exhaust the possibilities. A Google search on "hide email address" turns up over two million results. Even discounting duplicate methods, there are undoubtedly quite a few ingenious techniques available.

So what can I do now?

I don't suggest that you go through all 2 million of the Google results. I have a method that I have been using for some time that I guarantee does the best job of hiding your email address. How can I say that? Because it would be extremely difficult for any hacker to find it himself, much less program a bot to do it.

The method I use hides the address in a javascript that is in a separate web file in a completely different folder on the website. It does not appear anywhere in the HTML code of the webpage. Yet it DOES appear on the webpage itself where anyone can see it -- but the bot doesn't have eyes!

I hear you saying, "But that's impossible!" Well, it's not. Just visit the website in the paragraph below, and you can find out how it's done.

Visit the Professor's website, Professor's Coding Corner for useful code snippets and tutorials on interesting facets of web programming. In particular, the article, Stop Spambots will show you the best way to protect your website. Get a totally unique version of this article from our article submission service

Share and Enjoy:

  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Add to favorites
  • email
  • LinkedIn
  • Live
  • MSN Reporter
  • MySpace
  • Netvibes
  • NewsVine
  • PDF
  • Propeller
  • Reddit
  • RSS
  • Slashdot
  • SphereIt
  • StumbleUpon
  • Technorati
  • Twitter
  • Yahoo! Bookmarks