<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A Zend_Captcha example</title>
	<atom:link href="http://robertbasic.com/blog/a-zend-captcha-example/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertbasic.com/blog/a-zend-captcha-example/</link>
	<description>the magic of coding...</description>
	<lastBuildDate>Sun, 08 Jan 2012 19:22:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: vietanhit</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-3072</link>
		<dc:creator>vietanhit</dc:creator>
		<pubDate>Fri, 17 Jul 2009 20:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-3072</guid>
		<description>I&#039;ve solved the problem, replace

‘font’ =&gt; $baseUrl . ‘/img/arial.ttf’,
‘imgDir’ =&gt; $baseUrl . ‘/img/’,
‘imgUrl’ =&gt; ‘http://project.com/captcha/’,

with this:

&#039;font&#039; =&gt; &quot;./img/arial.ttf&quot;,
&#039;imgdir&#039; =&gt; &quot;./img&quot;,
&#039;imgurl&#039; =&gt; &quot;./img&quot;

Don&#039;t want to use $baseUrl .
Thanks this tutorial ! :)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve solved the problem, replace</p>
<p>‘font’ =&gt; $baseUrl . ‘/img/arial.ttf’,<br />
‘imgDir’ =&gt; $baseUrl . ‘/img/’,<br />
‘imgUrl’ =&gt; ‘http://project.com/captcha/’,</p>
<p>with this:</p>
<p>&#8216;font&#8217; =&gt; &#8220;./img/arial.ttf&#8221;,<br />
&#8216;imgdir&#8217; =&gt; &#8220;./img&#8221;,<br />
&#8216;imgurl&#8217; =&gt; &#8220;./img&#8221;</p>
<p>Don&#8217;t want to use $baseUrl .<br />
Thanks this tutorial ! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vietanhit</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-3060</link>
		<dc:creator>vietanhit</dc:creator>
		<pubDate>Fri, 17 Jul 2009 11:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-3060</guid>
		<description>I use &quot;arial.ttf&quot; font, put it in public/img folder:

$baseUrl = Zend_Controller_Front::getInstance()-&gt;getBaseUrl();		
		// Our form object...  
		$form = new Zend_Form();  
		// And here&#039;s our captcha object...  
		$captcha = new Zend_Form_Element_Captcha(  
			&#039;captcha&#039;, // This is the name of the input field  
			array(&#039;label&#039; =&gt; &#039;Write the chars to the field&#039;,  
					&#039;captcha&#039; =&gt; array( // Here comes the magic...  
						// First the type...  
						&#039;captcha&#039; =&gt; &#039;Image&#039;,  
						// Length of the word...  
						&#039;wordLen&#039; =&gt; 6,  
						// Captcha timeout, 5 mins  
						&#039;timeout&#039; =&gt; 300,  
						// What font to use...  
						&#039;font&#039; =&gt; $baseUrl . &#039;/img/arial.ttf&#039;,  
						// Where to put the image  
						&#039;imgDir&#039; =&gt; $baseUrl . &#039;/img/&#039;,  
						// URL to the images  
						// This was bogus, here&#039;s how it should be... Sorry again :S  
						&#039;imgUrl&#039; =&gt; &#039;http://project.com/captcha/&#039;,  
						)));</description>
		<content:encoded><![CDATA[<p>I use &#8220;arial.ttf&#8221; font, put it in public/img folder:</p>
<p>$baseUrl = Zend_Controller_Front::getInstance()-&gt;getBaseUrl();<br />
		// Our form object&#8230;<br />
		$form = new Zend_Form();<br />
		// And here&#8217;s our captcha object&#8230;<br />
		$captcha = new Zend_Form_Element_Captcha(<br />
			&#8216;captcha&#8217;, // This is the name of the input field<br />
			array(&#8216;label&#8217; =&gt; &#8216;Write the chars to the field&#8217;,<br />
					&#8216;captcha&#8217; =&gt; array( // Here comes the magic&#8230;<br />
						// First the type&#8230;<br />
						&#8216;captcha&#8217; =&gt; &#8216;Image&#8217;,<br />
						// Length of the word&#8230;<br />
						&#8216;wordLen&#8217; =&gt; 6,<br />
						// Captcha timeout, 5 mins<br />
						&#8216;timeout&#8217; =&gt; 300,<br />
						// What font to use&#8230;<br />
						&#8216;font&#8217; =&gt; $baseUrl . &#8216;/img/arial.ttf&#8217;,<br />
						// Where to put the image<br />
						&#8216;imgDir&#8217; =&gt; $baseUrl . &#8216;/img/&#8217;,<br />
						// URL to the images<br />
						// This was bogus, here&#8217;s how it should be&#8230; Sorry again :S<br />
						&#8216;imgUrl&#8217; =&gt; &#8216;<a href="http://project.com/captcha/&#039;" rel="nofollow">http://project.com/captcha/&#039;</a>,<br />
						)));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vietanhit</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-3059</link>
		<dc:creator>vietanhit</dc:creator>
		<pubDate>Fri, 17 Jul 2009 11:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-3059</guid>
		<description>getting these errors (ZF 1.8.4):

Warning: imageftbbox() [function.imageftbbox]: Invalid font filename in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 489

Warning: imagefttext() [function.imagefttext]: Invalid font filename in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 492

Warning: imagepng() [function.imagepng]: Unable to open &#039;/Zend_Framework/zf_captcha/public/img/ffa6e2ec474d49875ff2b131806c704c.png&#039; for writing: No such file or directory in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 563</description>
		<content:encoded><![CDATA[<p>getting these errors (ZF 1.8.4):</p>
<p>Warning: imageftbbox() [function.imageftbbox]: Invalid font filename in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 489</p>
<p>Warning: imagefttext() [function.imagefttext]: Invalid font filename in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 492</p>
<p>Warning: imagepng() [function.imagepng]: Unable to open &#8216;/Zend_Framework/zf_captcha/public/img/ffa6e2ec474d49875ff2b131806c704c.png&#8217; for writing: No such file or directory in C:\wamp\www\Zend_Framework\zf_captcha\library\Zend\Captcha\Image.php on line 563</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slawek</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-2284</link>
		<dc:creator>slawek</dc:creator>
		<pubDate>Wed, 10 Jun 2009 23:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-2284</guid>
		<description>Great tutorial - thank you.
I have one problem - when I refresh my page after giving wrong captcha code I get following error: &quot;Notice: Undefined index: word in E:\program\www\myapp\application\controllers\IndexController.php&quot;
I tryied to fix it with &quot;try&quot; but it doesn&#039;t work. Any ideas to solve this annoying problem. Gretz.</description>
		<content:encoded><![CDATA[<p>Great tutorial &#8211; thank you.<br />
I have one problem &#8211; when I refresh my page after giving wrong captcha code I get following error: &#8220;Notice: Undefined index: word in E:\program\www\myapp\application\controllers\IndexController.php&#8221;<br />
I tryied to fix it with &#8220;try&#8221; but it doesn&#8217;t work. Any ideas to solve this annoying problem. Gretz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-2277</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Sun, 07 Jun 2009 19:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-2277</guid>
		<description>Used your example on my site, but getting only the background with dots and lines, no text. Here&#039;s the code

        $captcha = new Zend_Form_Element_Captcha(&#039;captcha&#039;, array(
                &#039;label&#039; =&gt; &#039;Prove you are human:&#039;,
                &#039;captcha&#039; =&gt; array(
                &#039;captcha&#039; =&gt; &#039;Image&#039;,
                &#039;wordlen&#039; =&gt; 6,
                &#039;timeout&#039; =&gt; 300,
                &#039;font&#039;    =&gt; $_SERVER[&#039;DOCUMENT_ROOT&#039;] . &#039;/zf_whitenet/public/fonts/arial.ttf&#039;,
                &#039;imgDir&#039;  =&gt; &#039;captcha&#039;,
                &#039;imgUrl&#039;  =&gt; &#039;http://localhost/zf_whitenet/public/captcha&#039;)));
    
        $this-&gt;addElement($captcha);</description>
		<content:encoded><![CDATA[<p>Used your example on my site, but getting only the background with dots and lines, no text. Here&#8217;s the code</p>
<p>        $captcha = new Zend_Form_Element_Captcha(&#8216;captcha&#8217;, array(<br />
                &#8216;label&#8217; =&gt; &#8216;Prove you are human:&#8217;,<br />
                &#8216;captcha&#8217; =&gt; array(<br />
                &#8216;captcha&#8217; =&gt; &#8216;Image&#8217;,<br />
                &#8216;wordlen&#8217; =&gt; 6,<br />
                &#8216;timeout&#8217; =&gt; 300,<br />
                &#8216;font&#8217;    =&gt; $_SERVER['DOCUMENT_ROOT'] . &#8216;/zf_whitenet/public/fonts/arial.ttf&#8217;,<br />
                &#8216;imgDir&#8217;  =&gt; &#8216;captcha&#8217;,<br />
                &#8216;imgUrl&#8217;  =&gt; &#8216;<a href="http://localhost/zf_whitenet/public/captcha" rel="nofollow">http://localhost/zf_whitenet/public/captcha</a>&#8216;)));</p>
<p>        $this-&gt;addElement($captcha);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Viehweger</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-1913</link>
		<dc:creator>Jan Viehweger</dc:creator>
		<pubDate>Wed, 22 Apr 2009 15:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-1913</guid>
		<description>thanx for the good example!!!

@Anees
I&#039;ve had the same error. I could fix it by making a new instance of Zend_Captcha_Image. Look at my workaround:

	public function indexAction()
	{
		// Our form object...
		$form = new Zend_Form();
		// And here&#039;s our captcha object...

		$captchaImage = new Zend_Captcha_Image(array(
		        &#039;wordLen&#039; =&gt; 6,
		        // Captcha timeout, 5 mins
		        &#039;timeout&#039; =&gt; 300,
		        // What font to use...
		        &#039;font&#039; =&gt; &#039;/path/to/font/FontName.ttf&#039;,
		        // Where to put the image
		        &#039;imgDir&#039; =&gt; &#039;/var/www/project/public/captcha/&#039;,
		        // URL to the images
		        &#039;imgUrl&#039; =&gt; &#039;http://project.com/captcha/&#039;
		));

		$captchaElement = new Zend_Form_Element_Captcha(
		        &#039;captcha&#039;, // This is the name of the input field
		        array(&#039;label&#039; =&gt; &#039;Write the chars to the field&#039;,
		        &#039;captcha&#039; =&gt; $captchaImage));

		// Add the captcha element to the form...
		$form-&gt;setAction(&#039;/captcha/captcha/&#039;)
		        -&gt;setMethod(&#039;post&#039;)
		        // Add the captcha to the form...
		        -&gt;addElement($captchaElement)
		        -&gt;addElement(&#039;submit&#039;,&#039;Submit&#039;);
		// Pass the form to the view...
		$this-&gt;view-&gt;form = $form;
	}

hope this helps ...

jan</description>
		<content:encoded><![CDATA[<p>thanx for the good example!!!</p>
<p>@Anees<br />
I&#8217;ve had the same error. I could fix it by making a new instance of Zend_Captcha_Image. Look at my workaround:</p>
<p>	public function indexAction()<br />
	{<br />
		// Our form object&#8230;<br />
		$form = new Zend_Form();<br />
		// And here&#8217;s our captcha object&#8230;</p>
<p>		$captchaImage = new Zend_Captcha_Image(array(<br />
		        &#8216;wordLen&#8217; =&gt; 6,<br />
		        // Captcha timeout, 5 mins<br />
		        &#8216;timeout&#8217; =&gt; 300,<br />
		        // What font to use&#8230;<br />
		        &#8216;font&#8217; =&gt; &#8216;/path/to/font/FontName.ttf&#8217;,<br />
		        // Where to put the image<br />
		        &#8216;imgDir&#8217; =&gt; &#8216;/var/www/project/public/captcha/&#8217;,<br />
		        // URL to the images<br />
		        &#8216;imgUrl&#8217; =&gt; &#8216;<a href="http://project.com/captcha/" rel="nofollow">http://project.com/captcha/</a>&#8216;<br />
		));</p>
<p>		$captchaElement = new Zend_Form_Element_Captcha(<br />
		        &#8216;captcha&#8217;, // This is the name of the input field<br />
		        array(&#8216;label&#8217; =&gt; &#8216;Write the chars to the field&#8217;,<br />
		        &#8216;captcha&#8217; =&gt; $captchaImage));</p>
<p>		// Add the captcha element to the form&#8230;<br />
		$form-&gt;setAction(&#8216;/captcha/captcha/&#8217;)<br />
		        -&gt;setMethod(&#8216;post&#8217;)<br />
		        // Add the captcha to the form&#8230;<br />
		        -&gt;addElement($captchaElement)<br />
		        -&gt;addElement(&#8216;submit&#8217;,'Submit&#8217;);<br />
		// Pass the form to the view&#8230;<br />
		$this-&gt;view-&gt;form = $form;<br />
	}</p>
<p>hope this helps &#8230;</p>
<p>jan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-1051</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Fri, 20 Mar 2009 00:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-1051</guid>
		<description>That Zend stuff always confused me lol. Thanks for this clearly laid out and excellent tutorial. Noobs like me really really appreciate this kind of stuff. It makes me feel thankful that the internet exists because otherwise where the hell would I get the little tidbits I need now and again. Thanks again Robert.

Ron</description>
		<content:encoded><![CDATA[<p>That Zend stuff always confused me lol. Thanks for this clearly laid out and excellent tutorial. Noobs like me really really appreciate this kind of stuff. It makes me feel thankful that the internet exists because otherwise where the hell would I get the little tidbits I need now and again. Thanks again Robert.</p>
<p>Ron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dude</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-1046</link>
		<dc:creator>dude</dc:creator>
		<pubDate>Thu, 19 Mar 2009 12:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-1046</guid>
		<description>thanks alot ! now it works like a charm</description>
		<content:encoded><![CDATA[<p>thanks alot ! now it works like a charm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serega</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-1044</link>
		<dc:creator>Serega</dc:creator>
		<pubDate>Thu, 19 Mar 2009 08:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-1044</guid>
		<description>Good example!!!! A lot of thanx to you!!!!</description>
		<content:encoded><![CDATA[<p>Good example!!!! A lot of thanx to you!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie</title>
		<link>http://robertbasic.com/blog/a-zend-captcha-example/#comment-1025</link>
		<dc:creator>Charlie</dc:creator>
		<pubDate>Tue, 17 Mar 2009 15:59:05 +0000</pubDate>
		<guid isPermaLink="false">http://robertbasic.com/blog/?p=346#comment-1025</guid>
		<description>I had some hassle getting Zend to work with my PHP setup but once that worked, I managed to follow this tutorial in no time! My new app is now captcha-fied!</description>
		<content:encoded><![CDATA[<p>I had some hassle getting Zend to work with my PHP setup but once that worked, I managed to follow this tutorial in no time! My new app is now captcha-fied!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

