Obfuscated emailThroughout this site, I use email addresses that appear in clear to people browsing them. The main issue with email on webpages is that they get systematically collected by spammers using web spiders. Good thing is that these robots are not that sophisticated and are usually only able to identify well known email patterns. I've been using a short JavaScript snippet that I use in the source of webpages to dynamically write the proper HTML This directive is simply used in pmwiki as To use this new directive, simply copy the following into a file saved under <?php if (!defined('PmWiki')) exit(); # V1.0 /* Email obfuscation directive (:email me@home.com :) */ Markup('email','directives','/(:emails(.*?):)/e', "emailobfstcf('$1')"); function emailobfstcf($Email){ $Email = strrev(trim($Email)); $l= Keep("<script language='JavaScript'> <!-- var m='>A/<"). $Email. Keep(">'"). $Email. Keep(":otliam'=FERH a<'; var n=''; for (i=m.length-1; i>=0; i--) { n += m.charAt(i); } document.write(n); //--> </script>"); return $l; } ?> Don't forget to include a reference to it in your ... # Include the email obfuscator script include_once("cookbook/emailobfuscator.php"); ... That's all there is to it, Leave your comments below |