I'm using cfimage to generate a captcha. My script works great locally, but
chokes on my shared hosting account at Hostmysite.
I keep getting java.lang.IllegalStateException: Timer already cancelled.
errors.
Here is a stripped down version of my code:
cfCaptchaProxy.cfc:
<cffunction name="writeCaptcha" displayname="writeCaptcha" hint="I will output
the captcha image" access="remote" output="true" returntype="string">
<cfargument name="tabindex" type="numeric" required="false">
<cfset var ret = "">
<cfsavecontent variable="ret">
<cfoutput>
<cflock name="captcha" type="exclusive" timeout="2">
<cfimage action="captcha" height="#getCaptchaHeight()#"
width="#getCaptchaWidth()#" text="#getCaptchaString()#"
difficulty="#getDifficulty()#" fonts="arial,sans-serif">
</cflock>
<a href="##" id="reloadCaptcha" onClick="reload();return false"
title="load a new image" style="background-image:none"><img
src="/assets/images/icons/reload.png" width="20" height="21" alt="New Image"
style="border:none"/></a>
<br/>
<input type="text" name="registrationVerification"
class="formfield required" <cfif
structKeyExists(arguments,"tabIndex")>tabindex="#arguments.tabIndex#"</cfif>/>
<input type="hidden" name="captchaString"
value="#hash(UCase(getCaptchaString() ) )#" <cfif
structKeyExists(arguments,"tabIndex")>tabindex="#arguments.tabIndex#"</cfif>/><br/>
Please type the characters you see in the image. Not case
sensitive.
</cfoutput>
</cfsavecontent>
<cfreturn ret/>
</cffunction>
Contact form:
<cfajaxproxy cfc="model.cfcs.captcha.CFCaptchaProxy"
jsclassname="CFCaptchaProxy">
<script language="javascript">
$(window).load(function(){
loadCaptcha();
});//document).ready
function loadCaptcha(){
//proxy used to generate dropdown boxes
var cfCaptcha = new CFCaptchaProxy();
var stringField = cfCaptcha.writeCaptcha();
$('##captchaThingy').empty().append('<img
src="/assets/images/loading_orange.gif" width="31" height="31"
alt="processing..."/>').empty().append(stringField);
}
function reload() {
loadCaptcha();
return false;
};
</script>
Any help would be appreciated!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315116
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4