How to Stop Spammers from Ripping Your Pages

 
Apr 26, 2003

by Michael Dinowitz

One of the tools of the spammers trade is the intelligent agent. This is a piece of code that goes to a web page, reads through the HTML and looks for anything that looks like an email address. This email address is then added to a database and will inevitably be spammed.

How can we stop this? One option is to remove all email addresses from web pages. This is not really an option, as it removes the ability for someone to contact you. Another option is to provide a form that will allow a visitor to contact you. This is also a bit cumbersome and not really worth it. A third option is to hide the email address. This option takes into account something that is basic to HTML -- the fact that any extended character written in a certain way will be displayed properly.

Let me explain. Let's say you want a ¢ on your page. There is no character in HTML for this. Instead you have to use this:

¢ HTML will automatically turn the above into the ¢ sign. This same technique can be used with email addresses. All you have to do is convert each character of the email address into its extended form and *poof*, it's safe from just about every web agent. The agent will see a mass of characters that do not match a web address. A human looking at the page will see a real web address. As this is something based in HTML itself, it'll work on every browser around.

Here's a UDF that provides this functionality:

<CFSCRIPT>
 function AEmail(email)
 {
  var ascii="";
  for(i=1;i LTE len(email); i=i+1)
  {
   ascii=ascii&"&##"&asc(mid(email, i, 1))&";";
  }
  return ascii;
 }
</CFSCRIPT>
<CFOUTPUT>#AEmail('mdinowit@houseoffusion.com')#</CFOUTPUT>
		
Rather slick if I say so myself. This can be used in a static page by running an email address through this and pasting the results onto the static page. Instant spammer protection.

Just another tool in the war on spam.

Add a Comment
(If you subscribe, any new posts to this thread will be sent to your email address.)
  
Privacy | FAQ | Site Map | About | Guidelines | Contact | Advertising | What is ColdFusion?
House of Fusion | ColdFusion Jobs | Blog of Fusion | AHP Hosting