I have varying mailto: email address on my site which are now being hit with various harvesters and subsequently I'm being spammed.
Can anyone assist me in creating some PHP code for the following:
To prevent the address from being harvested and equally can I use this script on various email address displayed on the site?
And then, when you want to print an email address on the site:
If you want it to make it a clickable link:
<script>email('myuser', 'mydomain', true);</script>
Note: This is untested, but it should work. There are also more advanced techniques, which some of the other answers touch on, but most of them build off of a base like this.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki