Hi,
thanks so much for your help!
I tried(see below) but I get a error for the "="
this is just 1 page called image_text.cfm
<!---code --->
<cfif ("form.submit")>
<cfif id="userInput" eq Hash(#form.userInput#)>
<cfoutput>
you got it!
</cfoutput>
</cfif>
<cfelse>
<!--- Set the length of the text string for the CAPTCHA image. --->
<cfset stringLength=6>
<!--- Specify the list of characters used for the random text string. The
following list
limits the confusion between upper- and lowercase letters as well as between
numbers and
letters. --->
<cfset
stringList="2,3,4,5,6,7,8,9,a,b,d,e,f,g,h,j,n,q,r,t,y,A,B,C,D,E,F,G,H,K,L,M,N,P,Q,R,S,
T,U,V,W,X,Y,Z">
<cfset rndString="">
<!--- Create a loop that builds the string from the random characters. --->
<cfloop from="1" to="#stringLength#" index="i">
<cfset rndNum=RandRange(1,listLen(stringList))>
<cfset rndString=rndString & listGetAt(stringList,rndNum)>
</cfloop>
<!--- Hash the random string. --->
<cfset rndHash=Hash(rndString)>
<!--- Create the user entry form. ---><body id="userInput" name="userInput">
<cfform action="image_test.cfm" method="post" name="userInput" id="userInput">
<!--- Use the randomly generated text string for the CAPTCHA image. --->
<p><cfimage action="captcha" fontSize="16" fonts="Times New Roman" width="215"
height="50"
text="#rndString#"></p>
<p>Please type what you see: </p>
<p><cfinput type="text" name="userInput" required="yes">
<cfinput type="hidden" name="hashVal" value="#rndHash#">
<p><cfinput type="Submit" name ="OK" value="OK"></p>
</cfform>
<p>I'm sorry; please try again.</p>
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5259
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm