<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fish的航海日志 &#187; spam</title>
	<atom:link href="http://blog.v2op.com/tag/spam/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.v2op.com</link>
	<description>海到无边天做岸,山登绝顶我为峰</description>
	<lastBuildDate>Sat, 21 Aug 2010 06:38:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>拒绝垃圾邮件，隐藏email地址</title>
		<link>http://blog.v2op.com/2010/02/e-mail-links-protective-solutions-against-spam/</link>
		<comments>http://blog.v2op.com/2010/02/e-mail-links-protective-solutions-against-spam/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 12:25:02 +0000</pubDate>
		<dc:creator>AmirFish</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.v2op.com/?p=529</guid>
		<description><![CDATA[<p>如今的垃圾邮件是越来越猖狂了，稍不小心就会遭致无穷尽的骚扰。尽管有如同Gmail这样的强大的反垃圾邮件的服务商，仍有不少漏网之鱼（每天躺在我收件箱里的垃圾邮件会有几十封）。</p>
<p>我们需要避免直接在网页中留下email地址，例如 test@test.com。下面有一些简单且行之有效的方法隐藏email地址。</p>
<h2>方法一：使用图片显示email地址</h2>
<p>例如：<a href="http://blog.v2op.com/wp-content/uploads/2010/02/fish@email.png"><img class="alignnone size-full wp-image-530" title="fish@email" src="http://blog.v2op.com/wp-content/uploads/2010/02/fish@email.png" alt="" width="189" height="24" /></a></p>
<p>Google里搜索一下“email图片”类似的关键词，就可以找到有很多网站生成这样的图片</p>
<p>这里有一个：http://www.makepic.com/email.php</p>
<h2>方法二：隐藏 @ 符号</h2>
<ul>
<li>使用 &amp;#64; 代替 @，（是@符号的html实体代码）显示出来的效果会是 test@test.com</li>
<li>使用 at 或者其他任意字符 代替 @，例如 test at test.com、test(at)test.com</li>
</ul>
<h2>方法三：使用脚本语言（php或JavaScript）隐藏email地址</h2>
<h3>代码一：PHP</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> convert_email_adr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$pieces</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_split</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$new_mail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pieces</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$new_mail</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&amp;amp;#'</span><span style="color: #339933;">.</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$new_mail</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>在页面中调用此函数<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> convert_email_adr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user@email.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p></code><br />
输出结果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;#117;&amp;#115;&amp;#101;&amp;#114;&amp;#64;&amp;#101;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#46;&amp;#99;&amp;#111;&amp;#109;</pre></div></div>

<p></code></p>
<h3>代码二：JavaScript</h3>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> create_mail<span style="color: #009900;">&#40;</span>naam<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> tld<span style="color: #339933;">,</span> label<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> mail<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&lt;a href=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'ma'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'il'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'to:'</span> <span style="color: #339933;">+</span> naam<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&amp;#64;'</span> <span style="color: #339933;">+</span> mail <span style="color: #339933;">+</span> domain <span style="color: #3366CC;">'.'</span> <span style="color: #339933;">+</span> tld<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span> label <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/a&gt;'</span><span style="color: #339933;">;</span>
    document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>mail<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p></code><br />
在页面中插入此代码调用<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>create_mail<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;user&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;email&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;com&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;e-mail&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p></code></p>
<h3>代码三：</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> hide_email<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$character_set</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'</span><span style="color: #339933;">;</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_shuffle</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$character_set</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$cipher_text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">.</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">999999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #0000ff;">&quot;+d+&quot;</span><span style="color: #0000ff;">&quot;'; <span style="color: #006699; font-weight: bold;">$script</span> = &quot;</span><span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$script</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>)&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$script</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--mce:2--&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;[javascript protected email address]&lt;/span&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$script</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>在页面中调用此函数<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> hide_email<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test@test.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p></code><br />
输出结果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;e5119581&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span>javascript protected email address<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #666666; font-style: italic;">/*&lt;![CDATA[*/</span><span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;var a=<span style="color: #000099; font-weight: bold;">\&quot;</span>XyScbvBUW38fhasxldY_TQotLE5nCJDkgMVIq@KeArO9i20G1pHu.R4N6PZm7j-+wFz<span style="color: #000099; font-weight: bold;">\&quot;</span>;var b=a.split(<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>).sort().join(<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>);var c=<span style="color: #000099; font-weight: bold;">\&quot;</span>72m7a72m7S9NR<span style="color: #000099; font-weight: bold;">\&quot;</span>;var d=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>;for(var e=0;e&lt;c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));document.getElementById(<span style="color: #000099; font-weight: bold;">\&quot;</span>e5119581<span style="color: #000099; font-weight: bold;">\&quot;</span>).innerHTML=<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;a href=<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>mailto:<span style="color: #000099; font-weight: bold;">\&quot;</span>+d+<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span>+d+<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;/a&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">/*]]&gt;*/</span><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></div></div>

<p></code><br />
显示效果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">test@test.com</pre></div></div>

<p></code></p>
<p>代码一、代码二<a href="http://www.web-development-blog.com/archives/e-mail-links-protective-solutions-against-spam/">原文点击这里</a><br />
代码三<a href="http://www.maurits.vdschee.nl/php_hide_email/">原文点击这里</a></p>
<p>还有一些其他的方法，例如利用css翻转字符。大家可以自己搜搜看。</p>
]]></description>
			<content:encoded><![CDATA[<p>如今的垃圾邮件是越来越猖狂了，稍不小心就会遭致无穷尽的骚扰。尽管有如同Gmail这样的强大的反垃圾邮件的服务商，仍有不少漏网之鱼（每天躺在我收件箱里的垃圾邮件会有几十封）。</p>
<p>我们需要避免直接在网页中留下email地址，例如 test@test.com。下面有一些简单且行之有效的方法隐藏email地址。</p>
<h2>方法一：使用图片显示email地址</h2>
<p>例如：<a href="http://blog.v2op.com/wp-content/uploads/2010/02/fish@email.png"><img class="alignnone size-full wp-image-530" title="fish@email" src="http://blog.v2op.com/wp-content/uploads/2010/02/fish@email.png" alt="" width="189" height="24" /></a></p>
<p>Google里搜索一下“email图片”类似的关键词，就可以找到有很多网站生成这样的图片</p>
<p>这里有一个：http://www.makepic.com/email.php</p>
<h2>方法二：隐藏 @ 符号</h2>
<ul>
<li>使用 &amp;#64; 代替 @，（是@符号的html实体代码）显示出来的效果会是 test@test.com</li>
<li>使用 at 或者其他任意字符 代替 @，例如 test at test.com、test(at)test.com</li>
</ul>
<h2>方法三：使用脚本语言（php或JavaScript）隐藏email地址</h2>
<h3>代码一：PHP</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> convert_email_adr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$pieces</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_split</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$new_mail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pieces</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$new_mail</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&amp;amp;#'</span><span style="color: #339933;">.</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$new_mail</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>在页面中调用此函数<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> convert_email_adr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user@email.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p></code><br />
输出结果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;#117;&amp;#115;&amp;#101;&amp;#114;&amp;#64;&amp;#101;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#46;&amp;#99;&amp;#111;&amp;#109;</pre></div></div>

<p></code></p>
<h3>代码二：JavaScript</h3>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> create_mail<span style="color: #009900;">&#40;</span>naam<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> tld<span style="color: #339933;">,</span> label<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> mail<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&lt;a href=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'ma'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'il'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'to:'</span> <span style="color: #339933;">+</span> naam<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&amp;#64;'</span> <span style="color: #339933;">+</span> mail <span style="color: #339933;">+</span> domain <span style="color: #3366CC;">'.'</span> <span style="color: #339933;">+</span> tld<span style="color: #339933;">;</span>
    mail <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span> label <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/a&gt;'</span><span style="color: #339933;">;</span>
    document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>mail<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p></code><br />
在页面中插入此代码调用<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>create_mail<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;user&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;email&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;com&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;e-mail&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p></code></p>
<h3>代码三：</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> hide_email<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$character_set</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'</span><span style="color: #339933;">;</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_shuffle</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$character_set</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$cipher_text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">.</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">999999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #0000ff;">&quot;+d+&quot;</span><span style="color: #0000ff;">&quot;'; <span style="color: #006699; font-weight: bold;">$script</span> = &quot;</span><span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$script</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>)&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$script</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--mce:2--&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;[javascript protected email address]&lt;/span&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$script</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>在页面中调用此函数<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> hide_email<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test@test.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p></code><br />
输出结果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;e5119581&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span>javascript protected email address<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #666666; font-style: italic;">/*&lt;![CDATA[*/</span><span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;var a=<span style="color: #000099; font-weight: bold;">\&quot;</span>XyScbvBUW38fhasxldY_TQotLE5nCJDkgMVIq@KeArO9i20G1pHu.R4N6PZm7j-+wFz<span style="color: #000099; font-weight: bold;">\&quot;</span>;var b=a.split(<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>).sort().join(<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>);var c=<span style="color: #000099; font-weight: bold;">\&quot;</span>72m7a72m7S9NR<span style="color: #000099; font-weight: bold;">\&quot;</span>;var d=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\&quot;</span>;for(var e=0;e&lt;c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));document.getElementById(<span style="color: #000099; font-weight: bold;">\&quot;</span>e5119581<span style="color: #000099; font-weight: bold;">\&quot;</span>).innerHTML=<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;a href=<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>mailto:<span style="color: #000099; font-weight: bold;">\&quot;</span>+d+<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span>+d+<span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;/a&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">/*]]&gt;*/</span><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></pre></div></div>

<p></code><br />
显示效果<br />
<code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">test@test.com</pre></div></div>

<p></code></p>
<p>代码一、代码二<a href="http://www.web-development-blog.com/archives/e-mail-links-protective-solutions-against-spam/">原文点击这里</a><br />
代码三<a href="http://www.maurits.vdschee.nl/php_hide_email/">原文点击这里</a></p>
<p>还有一些其他的方法，例如利用css翻转字符。大家可以自己搜搜看。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.v2op.com/2010/02/e-mail-links-protective-solutions-against-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>spam无所不在</title>
		<link>http://blog.v2op.com/2008/09/spam-omnipresent/</link>
		<comments>http://blog.v2op.com/2008/09/spam-omnipresent/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 16:22:52 +0000</pubDate>
		<dc:creator>AmirFish</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://blog.v2op.com/?p=221</guid>
		<description><![CDATA[<p><a href="http://zh.wikipedia.org/w/index.php?title=%E5%9E%83%E5%9C%BE%E9%82%AE%E4%BB%B6&amp;variant=zh-cn">spam</a>就是一颗毒瘤。无孔不入，无所不在。<br />
技术日益先进，手段也日益丰富。</p>
<p>今天就收到一份颇有创新精神的spam邮件。咋一看还以为是应聘信息。顺便提一句，本人正在招聘WEB开发工程师（PHP/js/xhtml/css），有意者可邮件联系我。</p>
<p>点击小图看大图。</p>
<div id="attachment_222" class="wp-caption alignnone" style="width: 434px"><a href="http://blog.v2op.com/wp-content/uploads/2008/09/spam.png"><img class="size-medium wp-image-222" title="spam无所不在" src="http://blog.v2op.com/wp-content/uploads/2008/09/spam-424x700.png" alt="spam无所不在" width="424" height="700" /></a><p class="wp-caption-text">spam无所不在</p></div>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://zh.wikipedia.org/w/index.php?title=%E5%9E%83%E5%9C%BE%E9%82%AE%E4%BB%B6&amp;variant=zh-cn">spam</a>就是一颗毒瘤。无孔不入，无所不在。<br />
技术日益先进，手段也日益丰富。</p>
<p>今天就收到一份颇有创新精神的spam邮件。咋一看还以为是应聘信息。顺便提一句，本人正在招聘WEB开发工程师（PHP/js/xhtml/css），有意者可邮件联系我。</p>
<p>点击小图看大图。</p>
<div id="attachment_222" class="wp-caption alignnone" style="width: 434px"><a href="http://blog.v2op.com/wp-content/uploads/2008/09/spam.png"><img class="size-medium wp-image-222" title="spam无所不在" src="http://blog.v2op.com/wp-content/uploads/2008/09/spam-424x700.png" alt="spam无所不在" width="424" height="700" /></a><p class="wp-caption-text">spam无所不在</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.v2op.com/2008/09/spam-omnipresent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
