ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 20th, 2012, 08:28 AM
dsfx dsfx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 65 dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 18 h 38 m 2 sec
Reputation Power: 15
CFimage does not always display

Hey,

My setup is CF9 with IIS7 in Win Server 2008. I've written a custom captcha code that works great when CFIMAGE decides to display the captcha. The rest of the time the image is not loaded with the webpage. I've looked at the output code in the browser and it's just not there.

I can't find any bug listed for captcha like this and am unsure where the problem is. Anybody ever experience this before?

Here is my captcha code:


Code:
<!---select highest ID number as maxid--->
<CFQUERY name="maxsel" datasource="external">
	SELECT MAX(id) as maxid
    from captcha
</CFQUERY>

<!---Selectes random number between 1 and maxid value--->
<CFSET selid = #randrange(1, maxsel.maxid)#>

<!---Selects word from captcha database--->
<CFQUERY name="captcha" datasource="external">
	SELECT word
    FROM captcha
    WHERE ID = #selid#
</CFQUERY>

<!--- sets captcha size--->
<cfset size = 25 * 11 * 1.08/>

<FORM id="myform" action="success.cfm" method="post">
  <!---outputs the captcha selected word--->
  <CFOUTPUT query="captcha">
   <div class="red-text" id='myform_test_errorloc' ></div>
    <input name="test" size="35" type="text"  /><br />
    <!---creats the CF captcha image--->
    <cfimage action="captcha" fontSize="25" width="#size#" height="50" text="#word#" fonts="Verdana,Arial,Courier New,Courier" difficulty="low">
  </CFOUTPUT>
  <INPUT type="submit" name="submit"?
</FORM>

Reply With Quote
  #2  
Old September 20th, 2012, 08:35 AM
dsfx dsfx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 65 dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 18 h 38 m 2 sec
Reputation Power: 15
Quote:
Originally Posted by dsfx
Hey,

My setup is CF9 with IIS7 in Win Server 2008. I've written a custom captcha code that works great when CFIMAGE decides to display the captcha. The rest of the time the image is not loaded with the webpage. I've looked at the output code in the browser and it's just not there.

I can't find any bug listed for captcha like this and am unsure where the problem is. Anybody ever experience this before?

Here is my captcha code:


Code:
<!---select highest ID number as maxid--->
<CFQUERY name="maxsel" datasource="external">
	SELECT MAX(id) as maxid
    from captcha
</CFQUERY>

<!---Selectes random number between 1 and maxid value--->
<CFSET selid = #randrange(1, maxsel.maxid)#>

<!---Selects word from captcha database--->
<CFQUERY name="captcha" datasource="external">
	SELECT word
    FROM captcha
    WHERE ID = #selid#
</CFQUERY>

<!--- sets captcha size--->
<cfset size = 25 * 11 * 1.08/>

<FORM id="myform" action="success.cfm" method="post">
  <!---outputs the captcha selected word--->
  <CFOUTPUT query="captcha">
   <div class="red-text" id='myform_test_errorloc' ></div>
    <input name="test" size="35" type="text"  /><br />
    <!---creats the CF captcha image--->
    <cfimage action="captcha" fontSize="25" width="#size#" height="50" text="#word#" fonts="Verdana,Arial,Courier New,Courier" difficulty="low">
  </CFOUTPUT>
  <INPUT type="submit" name="submit"?
</FORM>


Ignore this please i figured it out. At some point last night i had to reinsert all the words into my database and removed the old ones which bumped the lowest id from 1 to 101. So there was a 50/50 chance of the word not showing up.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CFimage does not always display

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap