<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[PHP Forums - [TUTORIAL] How to make a simple captcha script]]></title>
		<link>http://phpforums.org/topic14-tutorial-how-to-make-a-simple-captcha-script.html</link>
		<description><![CDATA[The most recent posts in [TUTORIAL] How to make a simple captcha script.]]></description>
		<lastBuildDate>Wed, 04 Aug 2010 07:33:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [TUTORIAL] How to make a simple captcha script]]></title>
			<link>http://phpforums.org/post66.html#p66</link>
			<description><![CDATA[<p>hey thanks . . . !!!<br />just what i was expecting from this forum .<br />nice forum .</p>]]></description>
			<author><![CDATA[dummy@example.com (athore)]]></author>
			<pubDate>Wed, 04 Aug 2010 07:33:34 +0000</pubDate>
			<guid>http://phpforums.org/post66.html#p66</guid>
		</item>
		<item>
			<title><![CDATA[Re: [TUTORIAL] How to make a simple captcha script]]></title>
			<link>http://phpforums.org/post47.html#p47</link>
			<description><![CDATA[<p>Do you have a screenshot of which captcha script this code generates?&nbsp; I&#039;ve seen several versions and a couple I like and a couple I don&#039;t, so would like to know what this simple script generates, if possible.&nbsp; Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (Orrymain)]]></author>
			<pubDate>Fri, 20 Nov 2009 01:35:13 +0000</pubDate>
			<guid>http://phpforums.org/post47.html#p47</guid>
		</item>
		<item>
			<title><![CDATA[[TUTORIAL] How to make a simple captcha script]]></title>
			<link>http://phpforums.org/post25.html#p25</link>
			<description><![CDATA[<p>Hello,</p><p>Here is a tutorial on how to make a simple captcha script</p><div class="codebox"><pre><code>&lt;?php
session_start();
$strlength = rand(4,7);

for($i=1;$i&lt;=$strlength;$i++)
{
$textornumber = rand(1,3);
if($textornumber == 1)
{
$captchastr .= chr(rand(49,57));
}
if($textornumber == 2)
{
$captchastr .= chr(rand(65,78));
}
if($textornumber == 3)
{
$captchastr .= chr(rand(80,90));
}
}
$randcolR = rand(100,230);
$randcolG = rand(100,230);
$randcolB = rand(100,230);

/initialize image $captcha is handle dimensions 200,50
$captcha = imageCreate(200,50);
$backcolor = imageColorAllocate($captcha, $randcolR, $randcolG, $randcolB);

$txtcolor = imageColorAllocate($captcha, ($randcolR - 20), ($randcolG - 20), ($randcolB - 20));
for($i=1;$i&lt;=$strlength;$i++)
{

$clockorcounter = rand(1,2);
if ($clockorcounter == 1)
{
$rotangle = rand(0,45);
}
if ($clockorcounter == 2)
{
$rotangle = rand(315,360);
}

//$i*25 spaces the characters 25 pixels apart
imagettftext($captcha,rand(14,20),$rotangle,($i*25),30,$txtcolor,&quot;/arial.ttf&quot;,substr($captchastr,($i-1),1));
}
for($i=1; $i&lt;=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$txtcolor);
}
for($i=1; $i&lt;=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$backcolor);
}
//Send the headers (at last possible time)
header(&#039;Content-type: image/png&#039;);

//Output the image as a PNG
imagePNG($captcha);

//Delete the image from memory
imageDestroy($captcha);

$_SESSION[captchastr] = $captchastr;

?&gt;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (jaydesigns)]]></author>
			<pubDate>Sat, 10 Oct 2009 01:10:19 +0000</pubDate>
			<guid>http://phpforums.org/post25.html#p25</guid>
		</item>
	</channel>
</rss>
