1. imageType getImage(String myRandomNumber)
This uses cfcontent to create an image based on the random number,
pick a word to use and send it back to the browser as an image.
2. boolean validateEntry(String myRandomNumber, String userGuess)
Regens the same word from part 1 with myRandomNumber and compares the
result to the userGuess and returns true or false.
myRandomNumber is passed from page to page even as text since the
decode logic is all kept in the validateEntry piece.
----- Original Message -----
From: Bryan F. Hogan <[EMAIL PROTECTED]>
Date: Wed, 16 Jun 2004 16:23:27 -0400
Subject: Re: cfmx and CAPTCHA
To: CF-Talk <[EMAIL PROTECTED]>
Ok, ok, I've been holding off on this because I wanted to write
something up about it. Here it is.
1. Find an image package that will allow you to create and write text on
top of a image.
2. Create a file like below.
image.cfm
<cfset theImage=Your image manipulation package>
<cflock timeout="2" throwontimeout="yes" name="captchaImage">
<cfset session.captchaString=yourRandomUniqueStringGoesHere>
<cfset captchaString=session.captchaString>
</cflock>
<cfset theImage=write(session.captchaString)>
<cfcontent type="image/gif" reset="true>
<cfoutput>#variables.theImage#</cfoutput>
3. Include the image on your form
<img src="">
4. Include a field the user can type into.
5. Action page check form field with session.captchaString.
That's as simple as it gets.
Whittingham, P wrote:
> thanks...didn't know that.________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

