Obfuscating E-mail Addresses

Obfuscating E-mail Addresses

Do you ever wonder how your E-mail address gets on so many spam mailing lists? One way spammers collect E-mail addresses is from web pages. To help combat this problem, you can make your E-mail address show up in scrambled javascript in the HTML source, yet it it will look and work correctly in the browser. This is done with the {mailto} plugin.

Example 18-8. Example of Obfuscating an E-mail Address

{* in index.tpl *}

Send inquiries to
{mailto address=$EmailAddress encode="javascript" subject="Hello"}

Technical Note: This method isn't 100% foolproof. A spammer could conceivably program his e-mail collector to decode these values, but not likely....hopefully.

See also escape and {mailto}.

© Copyright 2003-2014 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.