#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    113
    Rep Power
    16

    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>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    113
    Rep Power
    16
    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.

IMN logo majestic logo threadwatch logo seochat tools logo