I am doing a travel blog in coldfusion and I would like to prevent automatic registration. Does anyone kindly provide some tutorial of random image with security code to prevent automatic registration? Thanks in advance!
Sure...I use a web service provided by Easycfm.com. In a nut shell, I consume the web service - this gives me a file name and the text equivalent. (This is done from the registration form template). I set the text value of the captcha using a session variable. After the form is posted, I compare the user entry to the session variable to ensure they match. EasyCFM.com has good example code: <cfscript> // Define the values to pass to the object theight = "350"; twidth = "350"; tfont = "Verdana"; tfontColor = "Black"; tfontSize = "12"; tfontOpacity = 100; tbgcolor1 = "white"; tbgcolor2 = "white"; tquality = 10; tdistortionMethod = 1; tXPos = 10; tYPos = 10; </cfscript> <cfinvoke webservice="http://www.easycfm.com/webservices/captcha.cfc?wsdl" method="generateCaptcha" returnvariable="aHashMap"> <cfinvokeargument name="height" value="#tHeight#"/> <cfinvokeargument name="width" value="#tWidth#"/> <cfinvokeargument name="font" value="#tFont#"/> <cfinvokeargument name="fontColor" value="#tFontColor#"/> <cfinvokeargument name="fontSize" value="#tfontSize#"/> <cfinvokeargument name="fontOpacity" value="#tfontOpacity#"/> <cfinvokeargument name="bgcolor1" value="#tbgcolor1#"/> <cfinvokeargument name="bgcolor2" value="#tbgcolor2#"/> <cfinvokeargument name="quality" value="#tquality#"/> <cfinvokeargument name="distortionMethod" value="#tdistortionMethod#"/> <cfinvokeargument name="XPos" value="#tXPos#"/> <cfinvokeargument name="YPos" value="#tYPos#"/> </cfinvoke> <!--- set the session variable ---> <cfset session.CAPTCHAWORD=#aHashMap.CAPTCHAWORD#> <!--- show the image ---> <img src="#aHashmap.image#"> In the reg form: <input type="text" name="catchaword"> In the action template: <cfif form.captchaword NEQ session.catpchaword> (do something) </cfif>
I'd just like to point out that CFMX 8 (in beta now, to be released in August or September) has this functionality built-in.
Even thought it's in beta, can anyone download it? If so, anyone have a link? Would greatly appreciate it. Thanks!