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.

Last update: 2008-08-18

2 Comments

  1. Willem
    Posted August 17, 2008 at 5:43 pm | Permalink

    Looks very nice.

    How safe is it?

  2. Posted August 18, 2008 at 10:53 am | Permalink

    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.

Post a Comment

Your email is never shared. Required fields are marked *

*
*