<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PHP Forums - [TUTORIAL] How to make a simple captcha script]]></title>
	<link rel="self" href="http://www.phpforums.org/feed-atom-topic14.xml"/>
	<updated>2010-08-04T07:33:34Z</updated>
	<generator>PunBB</generator>
	<id>http://phpforums.org/topic14-tutorial-how-to-make-a-simple-captcha-script.html</id>
		<entry>
			<title type="html"><![CDATA[Re: [TUTORIAL] How to make a simple captcha script]]></title>
			<link rel="alternate" href="http://phpforums.org/post66.html#p66"/>
			<content type="html"><![CDATA[<p>hey thanks . . . !!!<br />just what i was expecting from this forum .<br />nice forum .</p>]]></content>
			<author>
				<name><![CDATA[athore]]></name>
				<uri>http://phpforums.org/user45.html</uri>
			</author>
			<updated>2010-08-04T07:33:34Z</updated>
			<id>http://phpforums.org/post66.html#p66</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: [TUTORIAL] How to make a simple captcha script]]></title>
			<link rel="alternate" href="http://phpforums.org/post47.html#p47"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Orrymain]]></name>
				<uri>http://phpforums.org/user16.html</uri>
			</author>
			<updated>2009-11-20T01:35:13Z</updated>
			<id>http://phpforums.org/post47.html#p47</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[TUTORIAL] How to make a simple captcha script]]></title>
			<link rel="alternate" href="http://phpforums.org/post25.html#p25"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-10-10T01:10:19Z</updated>
			<id>http://phpforums.org/post25.html#p25</id>
		</entry>
</feed>

