We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14050
    • 788 Posts
    I am trying to implement Captcha for my contact form and am having some troubles with the vericode image intermittently not displaying. It seems to be an issue with the vericode.php file return an error sometimes.

    Basically, if the user has to hit refresh until it eventually displays. Here is one of the source calls that eForm is using for the src of the image:

    http://www.rmsnav.com/manager/includes/veriword.php?rand=39422884

    If I browse directly to that URL in Firefox, when the image does not display it just displays the URL again.

    If I browse directly to that URL in IE7 and hit refresh multiple times, I eventually get these errors:

    Warning: imagettfbbox() [function.imagettfbbox]: Could not read font in /home/rmsnav3/public_html/manager/includes/veriword.php on line 125
    
    Warning: Division by zero in /home/rmsnav3/public_html/manager/includes/veriword.php on line 130
    
    Warning: imagettfbbox() [function.imagettfbbox]: Could not read font in /home/rmsnav3/public_html/manager/includes/veriword.php on line 133
    
    Warning: imagettftext() [function.imagettftext]: Could not read font in /home/rmsnav3/public_html/manager/includes/veriword.php on line 156
    ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ<”"ÿÄ ÿĵ}!1AQa"q2?‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2?B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?÷#s¶õ¢2F>L…ÝÎ}ê´W3gÉ9™drØ]¤™ zZÒò“vâ£>¸¤6ñ´mQ±ºŒR[ŠÅ3u'Úæ‰H; ã>ç?Ò£kÙ£ï„üŒÎ¡¸ã­hìçŒãõ¦ùqŸá\}*¹—aY•ÍØFœo?ŠTo?ÞM$HÆÑر ùl¤.¹¦jЉ9;WÐñN ÀÔ]vLÎmAãóÆØÜ!H2q†ô#¾3øSF§ hÁç8ÎÙs»'/ô­«´®Ñ´õ¤òÓ#ä^:qÒ¥±™-ªÌös0kxä XI?$g‘׊±ÓE<Ëq…¡-?ã,Ù€¼b¯yQãZcýÚ<¨òÅÈèqÒ€3cÔ%¸Šà”U!â}ØÜ}ÇQWˆ™f ¼yB2½ëLvÑÅ"`…”üĹ$ýr? ²Ú¨Æ9æ˜qÝζÉ!š Y02àã À©žõ¢{•%£ˆ8?\g<çùUÏ&´ï¶3ݘÌÉ|a†FääqW¼¨ˆÆÄÇÐQåÄrv!Ï| š=Š‹xÿg?—dždc ž¯éÅX»¸6ö­"¨fÀ'Ÿ­Ú&hß‘³• ÄÈqBÚíbZidÝrþTt„Q]$ðG+N",¹Û¹McÊŒ?õkù )hDÔ´QTIÊ»ÛʱcyR'8¬I¡¼µÒ1º:£am[nÆ= èOÐô®?ÝcFf8 2xª£QµXRYdòU³?*”<{@>T•íJÁ)?È\Œãó¤´Žæ(vÜÏç>s»h~TæXÖ=ìêÜN$rÇ*î?ÕצTäS¾–$ÚÝJ÷eþÐ?Ú¾n2sÆÒ޵Hb“Í·&;¨ãU;ˆœ9ÈÝ–çõüjÜš?¤~fùÐþøô¥ûu¨1ƒ: ÊzÕóK°®n¡»?£´œM( ?o2îõëP½½ÊÝFûîDÁÛÁÈo›“î5©4ñ@›æp‰œn=*1}jY@?2Ã#ž¢’m-Vë<šh&ÞâRÁÙI-Ô°Éà{qô©Ù/›Q"H‘²ã†ÕãŒ?Ýsè?VÍü –ó”–GïÉ©¾Ó—É2(“ÛžqMÉÝ»‘5µã@Bíl²™C1ã¨;‡íŸÂ®ºJnTà’`eRxÃqœã§oÈÔ¿Ú›7ý¢=¹Ûœ÷§½Äk By*_ŽÀúé9K°RÚeµ‡tgr±%"?§úŠzG"Hçɘ«oʇuÇÞÞõÔÊ_ÁlòG¹¢ÜÊ’O·§JMÊ:û}2ad±ÉpRMª¹@v {iH÷báå,øÁùOë×Ô¶ÚƒHò,Ѥ!U[w˜wg½¿ýuy²Pã®(ç•îtÚJÜ J$e9Rñ)cÁ;Z~ôØ_(ÆÀqô#Ó½"=Ôpbf?¦bm?ýt§íBrwÇäí8çžfºÓm§’æ`î™;Hϵ^͈ÿÙ


    Sometimes it takes the user 3-5 refreshes before the image displays. Anyone have any ideas?
      Jesse R.
      Consider trying something new and extraordinary.
      Illinois Wine

      Have you considered donating to MODx lately?
      Donate now. Every contribution helps.
      • 29181
      • 480 Posts
      I was having a few problems with Vericode and eForm at the beginning of the week too. As it happened Apache didn’t have freetype support and needed recompiling. Maybe put:

      <?php
      var_dump(gd_info());
      ?>


      in a snippet and see what that kicks out. Maybe you can see that something is set to false that shouldn’t be.

      Hope that helps,
      Taff
        Adrian Lawley: www.adrianlawley.com
        • 14050
        • 788 Posts
        Why would that cause intermittent problems? I would think that if something was set to false that shouldn’t be it would cause it to not work at all.
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.
          • 14050
          • 788 Posts
          Well, I solved it by editing the veriword.php located in manager/includes:

          There is some wonky in the legacy code from the etomite days still in there that I think is causing the problem. I then went into the manager/includes/ttf directory and changed the only font in there to font1.ttf (I don’t see the need to randomly select the font if there is only one font in there. I think this random selection of the font was the cause of it intermitentlly working.

          Around line 43 change the directory to:

          var $dir_font 	= "ttf/";


          Around line 108 I changed the code to comment out the following:

          /* pick one font type randomly from font directory */
          		$text_font 	= $this->dir_font."font1.ttf";
          		
          			// added by Alex - read ttf dir
          			/*$dir = dir("./ttf");
          			$fontstmp = array();
          			while ($file = $dir->read()) {
          				if($file!="." && $file!="..") {
          					$fontstmp[] = './ttf/'.$file;
          				}
          			}
          			$dir->close(); 
          			$text_font = sprintf("%s",$fontstmp[array_rand($fontstmp)]);*/


          Hope this helps someone and is included in the official release.
            Jesse R.
            Consider trying something new and extraordinary.
            Illinois Wine

            Have you considered donating to MODx lately?
            Donate now. Every contribution helps.
            • 14050
            • 788 Posts
            Can anyone confirm that this is a bug? Maybe it was unique to my install. I still don’t see the necessity of the random font selection when the basic MODx package only includes one font.
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 15586
              • 1 Posts
              I had a similar problem. I got the error undefined function imagettfbbox(). My problem was that I didn’t have the freetype library. I recompiled php with TTF and it works smiley