<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Flash based alternative to mailto:</title>
	<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/</link>
	<description>web application development with popular technologies</description>
	<pubDate>Fri, 29 Aug 2008 19:07:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: Richard Lee</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-104151</link>
		<pubDate>Fri, 02 May 2008 04:30:11 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-104151</guid>
					<description>Hi Simon, have u tried cutting and pasting the link you see in the source into your browser - does the image appear? Because it sounds like a paths issue to me</description>
		<content:encoded><![CDATA[<p>Hi Simon, have u tried cutting and pasting the link you see in the source into your browser - does the image appear? Because it sounds like a paths issue to me
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Simon Ferrari</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-102489</link>
		<pubDate>Sun, 20 Apr 2008 17:05:16 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-102489</guid>
					<description>Hi,
I was looking for something like this but I'm not familiar with scripts and the like and have used NetObjects Fusion to create my website.
I've created a file called nospam.php (which has got the code above starting with the line "if (!empty($_GET['user']) &#38;&#38; !empty($_GET['domain']))...."  and copied that to the same directly as my html pages.
I've then inserted the code :
&lt;a href="mailit('joebloggs', 'gmail.com')" rel="nofollow"&gt;&lt;/a&gt;
in place of the mailto in my web page and changed the http:... bit to the location where I put the nospam.php file.
I was expecting to see the email address rendered as an image but I just get one of those square image placeholders however clicking on this does work and open outlook with right To address.  Why is the image not looking right?

Simon</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I was looking for something like this but I&#8217;m not familiar with scripts and the like and have used NetObjects Fusion to create my website.<br />
I&#8217;ve created a file called nospam.php (which has got the code above starting with the line &#8220;if (!empty($_GET[&#8217;user&#8217;]) &amp;&amp; !empty($_GET[&#8217;domain&#8217;]))&#8230;.&#8221;  and copied that to the same directly as my html pages.<br />
I&#8217;ve then inserted the code :<br />
<a href="mailit('joebloggs', 'gmail.com')" rel="nofollow"></a><br />
in place of the mailto in my web page and changed the http:&#8230; bit to the location where I put the nospam.php file.<br />
I was expecting to see the email address rendered as an image but I just get one of those square image placeholders however clicking on this does work and open outlook with right To address.  Why is the image not looking right?</p>
<p>Simon
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Cameron Manderson</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25239</link>
		<pubDate>Wed, 28 Feb 2007 11:43:52 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25239</guid>
					<description>Nice snippets!</description>
		<content:encoded><![CDATA[<p>Nice snippets!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Richard Lee</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25210</link>
		<pubDate>Wed, 28 Feb 2007 04:27:49 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25210</guid>
					<description>And if you wanted to have the email address appear simply render the text with PHP
&lt;pre&gt;if (!empty($_GET[&#039;user&#039;]) &#38;&#38; !empty($_GET[&#039;domain&#039;])) {&lt;br /&gt;
&#160;&lt;br /&gt;
$string = trim($_GET[&#039;user&#039;]).&#039;@&#039;.trim($_GET[&#039;domain&#039;]);&lt;br /&gt;
$line = array(&#34;linespacing&#34; =&#38;gt; 0);&lt;br /&gt;
$fontsize = 12;&lt;br /&gt;
$fontfile = &#039;verdana.ttf&#039;;&lt;br /&gt;
$imgH = 18;&lt;br /&gt;
$marginX = 0;&lt;br /&gt;
$imgColorHex = &#039;000000&#039;;&lt;br /&gt;
$txtColorHex = &#039;FFFFFF&#039;;&lt;br /&gt;
&#160;&lt;br /&gt;
$box = imageftbbox($fontsize,0,$fontfile,$string,$line) or die(&#34;ERROR&#34;);&lt;br /&gt;
$tw= $box[4]-$box[0]; //image width&lt;br /&gt;
$marginY = $imgH - (($imgH - $fontsize) / 2);&lt;br /&gt;
$imgW = $tw + (2*$marginX);&lt;br /&gt;
$im = imagecreate($imgW, $imgH);&lt;br /&gt;
$int = hexdec($imgColorHex);&lt;br /&gt;
$arr = array(&#34;red&#34; =&#38;gt; 0xFF &#38; ($int &#38;gt;&#38;gt; 0x10),&lt;br /&gt;
&#34;green&#34; =&#38;gt; 0xFF &#38; ($int &#38;gt;&#38;gt; 0x8),&lt;br /&gt;
&#34;blue&#34; =&#38;gt; 0xFF &#38; $int);&lt;br /&gt;
$black = imagecolorallocate($im, $arr[&#34;red&#34;], $arr[&#34;green&#34;], $arr[&#34;blue&#34;]);&lt;br /&gt;
$int = hexdec($txtColorHex);&lt;br /&gt;
$arr = array(&#34;red&#34; =&#38;gt; 0xFF &#38; ($int &#38;gt;&#38;gt; 0x10),&lt;br /&gt;
&#34;green&#34; =&#38;gt; 0xFF &#38; ($int &#38;gt;&#38;gt; 0x8),&lt;br /&gt;
&#34;blue&#34; =&#38;gt; 0xFF &#38; $int);&lt;br /&gt;
$white = imagecolorallocate($im, $arr[&#34;red&#34;], $arr[&#34;green&#34;], $arr[&#34;blue&#34;]);&lt;br /&gt;
header(&#34;Content-type: image/png&#34;);&lt;br /&gt;
imagefttext($im, $fontsize, 0, $marginX, $marginY, $white, $fontfile, $string, array());&lt;br /&gt;
imagepng($im);&lt;br /&gt;
} else {&lt;br /&gt;
echo &#34;ERROR!&#34;;&lt;br /&gt;
}&lt;br /&gt;
?&#62;&lt;/pre&gt;
And here's an example with the addition of our js function above:

&lt;code&gt;&#60;a href=&#34;javascript:mailit(&#039;joebloggs&#039;, &#039;gmail.com&#039;)&#34; rel=&#34;nofollow&#34;&#62;&#60;img src=&#34;http://www.melbournechapter.net/wordpress/nospam.php?user=joebloggs&#38;domain=google.com&#34; /&#62;&#60;/a&#62;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>And if you wanted to have the email address appear simply render the text with PHP</p>
<pre>if (!empty($_GET[&#039;user&#039;]) &amp;&amp; !empty($_GET[&#039;domain&#039;])) {
&nbsp;
$string = trim($_GET[&#039;user&#039;]).&#039;@&#039;.trim($_GET[&#039;domain&#039;]);
$line = array(&quot;linespacing&quot; =&amp;gt; 0);
$fontsize = 12;
$fontfile = &#039;verdana.ttf&#039;;
$imgH = 18;
$marginX = 0;
$imgColorHex = &#039;000000&#039;;
$txtColorHex = &#039;FFFFFF&#039;;
&nbsp;
$box = imageftbbox($fontsize,0,$fontfile,$string,$line) or die(&quot;ERROR&quot;);
$tw= $box[4]-$box[0]; //image width
$marginY = $imgH - (($imgH - $fontsize) / 2);
$imgW = $tw + (2*$marginX);
$im = imagecreate($imgW, $imgH);
$int = hexdec($imgColorHex);
$arr = array(&quot;red&quot; =&amp;gt; 0xFF &amp; ($int &amp;gt;&amp;gt; 0&#215;10),
&quot;green&quot; =&amp;gt; 0xFF &amp; ($int &amp;gt;&amp;gt; 0&#215;8),
&quot;blue&quot; =&amp;gt; 0xFF &amp; $int);
$black = imagecolorallocate($im, $arr[&quot;red&quot;], $arr[&quot;green&quot;], $arr[&quot;blue&quot;]);
$int = hexdec($txtColorHex);
$arr = array(&quot;red&quot; =&amp;gt; 0xFF &amp; ($int &amp;gt;&amp;gt; 0&#215;10),
&quot;green&quot; =&amp;gt; 0xFF &amp; ($int &amp;gt;&amp;gt; 0&#215;8),
&quot;blue&quot; =&amp;gt; 0xFF &amp; $int);
$white = imagecolorallocate($im, $arr[&quot;red&quot;], $arr[&quot;green&quot;], $arr[&quot;blue&quot;]);
header(&quot;Content-type: image/png&quot;);
imagefttext($im, $fontsize, 0, $marginX, $marginY, $white, $fontfile, $string, array());
imagepng($im);
} else {
echo &quot;ERROR!&quot;;
}
?&gt;</pre>
<p>And here&#8217;s an example with the addition of our js function above:</p>
<p><code>&lt;a href=&quot;javascript:mailit(&#039;joebloggs&#039;, &#039;gmail.com&#039;)&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://www.melbournechapter.net/wordpress/nospam.php?user=joebloggs&amp;domain=google.com&quot; /&gt;&lt;/a&gt;</code>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Richard Lee</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25204</link>
		<pubDate>Wed, 28 Feb 2007 02:47:12 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-25204</guid>
					<description>Yep, here's my simple javascript alternative - I believe the spam bots target "mailto" in the source and any formed email addresses:
&lt;pre&gt;&lt;br /&gt;
&#60;script language=&#34;javascript&#34;&#62;&lt;br /&gt;
&#160;&lt;br /&gt;
function mailit(user, domain) {&lt;br /&gt;
  window.location.href=&#34;mailto:&#34;+user+&#34;@&#34;+domain;&lt;br /&gt;
}&lt;br /&gt;
&#160;&lt;br /&gt;
&#60;/script&#62;&lt;br /&gt;
&#160;&lt;br /&gt;
&#60;body&#62;&lt;br /&gt;
&#60;a href=&#34;javascript:mailit(&#039;joebloggs&#039;, &#039;gmail.com&#039;)&#34; rel=&#34;nofollow&#34;&#62;Email&#60;/a&#62;&lt;br /&gt;
&#60;/body&#62;&lt;br /&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Yep, here&#8217;s my simple javascript alternative - I believe the spam bots target &#8220;mailto&#8221; in the source and any formed email addresses:</p>
<pre>
&lt;script language=&quot;javascript&quot;&gt;
&nbsp;
function mailit(user, domain) {
  window.location.href=&quot;mailto:&quot;+user+&quot;@&quot;+domain;
}
&nbsp;
&lt;/script&gt;
&nbsp;
&lt;body&gt;
&lt;a href=&quot;javascript:mailit(&#039;joebloggs&#039;, &#039;gmail.com&#039;)&quot; rel=&quot;nofollow&quot;&gt;Email&lt;/a&gt;
&lt;/body&gt;
</pre>
]]></content:encoded>
				</item>
	<item>
		<title>by: Cameron Manderson</title>
		<link>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-24559</link>
		<pubDate>Sat, 24 Feb 2007 23:41:04 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/security/rich/2007/02/22/flash-based-alternative-to-mailto/#comment-24559</guid>
					<description>It isn't a bad concept, I like it.. Taking the precaution of using javascript at a minimum would be a start though, maybe a link to how to do that if people don't want to have flash running on their site, or haven't purchased flash. Alternatively, maybe we could link to a pre-built SWF that allows users to also specify the CSS and maybe have a JS that can resize itself as an embedded object so that it doesn't always be 200width (or have to guess what is big enough in the case that it is dynamic).</description>
		<content:encoded><![CDATA[<p>It isn&#8217;t a bad concept, I like it.. Taking the precaution of using javascript at a minimum would be a start though, maybe a link to how to do that if people don&#8217;t want to have flash running on their site, or haven&#8217;t purchased flash. Alternatively, maybe we could link to a pre-built SWF that allows users to also specify the CSS and maybe have a JS that can resize itself as an embedded object so that it doesn&#8217;t always be 200width (or have to guess what is big enough in the case that it is dynamic).
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
