A McGraw Hill Book Plug-in PHP: 100 Power Solutions
By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596)

Home | About | Buy It | Download | Contact

Select Chapter: 1  2  3  4  5  6  7  8  9 10 11 12

Chapter 11: Plug-in 84 - Protect Email

You know the dilemma; you need to get your email address out there so that people can contact you, but doing so leaves you open to being added to spam lists by automatic email address harvesting programs. Well this plug-in has the solution by obfuscating your email address using JavaScript code.

The Figure shows an email address which has been displayed making it both copyable and clickable but, as the inset source view shows, the email address itself doesn't appear as a whole within the page, because it has been split into three JavaScript variables and then re-assembled, meaning that only a sophisticated harvesting 'bot', capable of parsing and running JavaScript, could make sense of it.