An accessible email cloaking technique

I suppose that you do not write your email on webpages but if you have to deal with people that do want to, you have to find some trick to protect them.

I’ve found a good list of techniques to achieve this task but when you can’t use anything like CSS, images or JavaScript it’s harder so I’ve written a small PHP script that uses two techniques:

  • writing everything (text and email) directly in hexadecimal;
  • putting, between each character of the text, a (X)HTML comment with random content (‘@’ or ‘>’ as suggested).

In other words, calling
$email = 'carlo@some.where';
$testo = 'text to show';
echo oemail($email);

would show something like the source of this file.

The result is not enough to save your life but it can be a decent method, though.

You can download it here.

2 thoughts on “An accessible email cloaking technique”

  1. Willem: spammers work on big numbers… so they might not concentrate themselves on a few hard to catch email addresses. I’ve tried it on real websites: as I wrote, the result is not enough to save your life but it can be a decent method when your customers want to put an email directly on a webpage.

Leave a Reply

Your email address will not be published. Required fields are marked *