You are here: Re: Obfuscating email addresses in mailto: links « HTML « IT news, forums, messages
Re: Obfuscating email addresses in mailto: links

Posted by Chris F.A. Johnson on 09/04/07 02:06

On 2007-09-03, andrew wrote:
> On 2007-09-03, JL <user@example.net> wrote:
>> Hi all
>>
>> The other day, I encountered a site with a mailto link like this:
>>
>><a
>> href="mailto:&#105;&#110;&#102;&#111;&#064;&#101;&#120;&#097;&#109
> ;&#112;&#108;&#101;&#046;&#099;&#111;&#109;">
>> &#105;&#110;&#102;&#111;&#064;&#101;&#120;&#097;&#109;&#112;&#108;
> &#101;&#046;&#099;&#111;&#109;
>></a>
>>
>> Will this actually prevent anything from harvesting the email address?
>
> I have used this technique and it has proved very successful. Because
> I am a little lazy I used the following:
>
> http://www.addressmunger.com/
>
> to generate the mess :-)

I use this shell script:

## Convert e-mail address to obfuscated format for web pages
## Author: Chris F.A. Johnson, copyright 2007
w2()
{
w2h=$1
while [ -n "$w2h" ]
do
temp=${w2h#?}
printf "$2" "'${w2h%"$temp"}"
w2h=$temp
done
}

mailto="&#109;&#97;&#105;&#108;&#116;&#111;&#58;"
anchor='<a href="'
gt=">"
closetag="</a>"

url=$( w2 "${1// /}" "%%%x" )
daddr=$( w2 "$1" "&#%d;" )

link="$anchor$mailto$url\"$gt$daddr</a>"

printf "%s\n" "$link"


--
Chris F.A. Johnson <http://cfaj.freeshell.org>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация