We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21395
    • 91 Posts
    Bob

    SPForm works fine, both in math test and non-math-test mode.

    debug text all here:

    Path to spfconfig file:
    /home/benedic1/public_html/etaxtoday/assets/snippets/spform/spfconfig.cfg.php
    Path to lang file:
    /home/benedic1/public_html/etaxtoday/assets/snippets/spform/lang/en.inc.php
    Verify URL:
    http://www.etaxtoday.benedictustest.com/assets/snippets/spform/spfveriword.php
    errorsto: [email protected]
    spfUseSMTP:
    spfSMTP_Host:
    spfSMTP_Port:
    useHiddenField:
    warnHiddenField: 1
    logOnHidden:
    requireMouseOrKeyboard:
    requireKeyboard:
    requireMouse:
    logMouseAndKeyboardErrors: 1
    addSubjSig: 1
    dfltSubj: etaxtoday.benedictustest.com contact
    maxLinks: 3
    maxRecipientLen: 65
    maxSubjectLen: 100
    mailAlso:
    requireName: 1
    requireSubj: 1
    requireEmail: 1
    spTextRows: 10
    spTextCols: 50
    spShowSingleRecipientTo:
    requireVerify: 1
    usemathString:
    warnVerify: 1
    reportRemoteHost: 1
    reportRemoteUser: 1
    reportRemoteAddr: 1
    reportRemoteIdent: 1
    reportOrigReferer: 1
    formProcBlankRefOkay: 1
    adviseOnReferer:
    logOnReferer:
    warnBanned: 1
    adviseOnBan:
    logOnBan:
    adviseOnVerify:
    logOnVerify:
    chkFormRefNotSelf:
    chkFormRefOwnServer:
    chkFormRefNotBlank:
    (Cookies must be enabled to use this form.)

    Here’s my solution of course: just use SPForm - but I think that is going to be easier said than done. My current form feeds the output of 50 fields into a database (eForm2db) then builds a file from the same dataset and emails it to someone and sends acknowledgement emails to two parties. - I just wanted to add the captcha verify option as the last step...

    Anyway - SPForm works, eForm doesn’t, so whatever is wrong, it isn’t something to do with PHP GD libraries etc.

    So now I’m a bit stuck.

    By the way, in the process of studying this, I turned captcha on for CMS logins. Couldn’t get in,so had to nobble the MySQL database direct to recover. Again, I could clearly read the Captcha codes, and typed them in cleanly, but they weren’t accepted.

    Any ideas?



    Nic Boyde
      MODX Revolution 2.6.5-pl (traditional)

      Hosted on MODX Cloud

      Skype: nicbaldeagle
      • 3749
      • 24,544 Posts
      That is truly odd.

      SPForm, Login CAPTCHA, and eForm all save the correct CAPTCHA answer to a $_SESSION variable, then check the user’s input against that $_SESSION variable for validation.

      AFAIK, the code that does this in SPForm is the same as in the others. You could compare the two and see if there’s a difference in the session handling.

      I guess it’s possible that your main vericode.php file is corrupted, but it seems really unlikely since it produces an image.

      Trying to use SPForm for what you want would be a real nightmare since it’s not designed to have extra fields added or interact with eForm2DB.

      It would probably be easier (though still a major job) to integrate the Mollom class (which has its own version of CAPTCHA and some other nice features) with eForm.

      You might try to replace the main vericode.php file with the one in the SPForm directory, but it would get overwritten if you update MODx. I think it would work, but I’ve never tried it.

      I wish I could be more helpful. :’(
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Since the spammers have utilities to scan and read CAPTCHA images now, I quit using them. I have a dummy field hidden with CSS that is tested to make sure it remains empty, and since I put that on my site I haven’t received a single spam contact message. It’s in a snippet named checkField, and uses &eformOnValidate=`checkField` in the eForm snippet call.
        <?php
        function checkField(&$fields,&$vMsg,&$rMsg) {
            if(!empty($fields['Last__Name'])) {
                return false;
            } else {
            return true;
            }
        }
        ?>
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 21395
          • 91 Posts
          Dear Bob and Susan

          Firstly, Bob, I had come to the same conclusions about SESSION handling - but I don’t know enough about php to know what I’m doing in terms of spotting what might be wrong. And since I’m the only person, apparently, with the problem, it probably won’t benefit the MODx Community at large to find out what it might be.

          I’m going to try Susan’s suggestion next - I’d seen several references to it on my hunt for elucidation - and as CAPTCHA is only a means to an end, anything else that provides the same end will do fine.

          So thank you both for your unflagging help for those of us in dire straits.

          Nic Boyde
            MODX Revolution 2.6.5-pl (traditional)

            Hosted on MODX Cloud

            Skype: nicbaldeagle
            • 3749
            • 24,544 Posts
            Good luck. smiley

            I call the hidden field something seductive like last_name.

            Here’s the CSS SPform uses to hide the extra field without being penalized (it’s not technically "hidden," just invisible):

            .spform_input {
            	position:absolute;
            	text-decoration:underline;
            	background-color:#CC0000;
            	left:0px;
            	top:-500px;
            	width:1px;
            	height:1px;
            	overflow:hidden;
            }

            If you look in assets/snippets/spform/spform.inc.php you can see some other spam-proofing measures.

            BTW, the hidden field has not been completely foolproof for me.

            Also, putting this near the top of your .htaccess file will block a lot of form-prospecting bots.

            #first, block bad bots
            RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
            RewriteRule .* - [F,L]
            
            RewriteCond %{QUERY_STRING} snippet\.reflect\.php [NC,OR]
            RewriteCond %{QUERY_STRING} reflect_base [NC,OR]
            RewriteCond %{HTTP_USER_AGENT} ^libwww-perl [NC]
            RewriteCond %{QUERY_STRING} (.*)(http|https|ftp):\/\/(.*) [NC]
            RewriteRule .* - [F,L]
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 13228
              • 8 Posts
              Hi Everybody!
              I am a front-end web developer. I’ll start building sites on MODX and hopefully contributing the community in the near future.
              I have the same problem. I always get "Wrong Verification Code" msg.
              BTW, you shouldn’t said SOLVED when not (unless the solution is to change the snippet or not using captcha).

              Let say that everything is implemented correctly - Is it possible that eForm 1.4.4.6 on MODx Evolution 1.0.0 just has the bug above?
              I love eForm and I would love to use it.


                Everything is EASY if you wanna do it badly.
                • 14828
                • 7 Posts
                Quote from: sottwell at Aug 08, 2009, 05:28 AM

                Since the spammers have utilities to scan and read CAPTCHA images now, I quit using them. I have a dummy field hidden with CSS that is tested to make sure it remains empty, and since I put that on my site I haven’t received a single spam contact message. It’s in a snippet named checkField, and uses &eformOnValidate=`checkField` in the eForm snippet call.
                <?php
                function checkField(&$fields,&$vMsg,&$rMsg) {
                    if(!empty($fields['Last__Name'])) {
                        return false;
                    } else {
                    return true;
                    }
                }
                ?>


                Can someone tell me how I have to use this in my my formular. I think I have an input field

                <p class="nosee"><label for="Last__Name">You should not fill out this label (Spam Detection)</label>
                <input type="text" id="Last__Name" name="Last__Name" size="40" maxlength="40" /></p>


                But where is the call for the snippet. Is the Snippet automaically called by &eformOnValidate=`checkField`?

                Greetings Jo_shi
                  • 38685
                  • 59 Posts
                  Hi Jo_shi....

                  I load the snippet before my eForm one like this.....

                  [!eCheckField!]! Which is the actual name of the snippet not the function it contains.... before...
                  [!eform? &to=`your email@your email.com` &subject=`This is how to do it!` &eformOnValidate=`checkField` etc.... !]

                    Paul AL Bakulich - Association for Computing Machinery Professional Member
                    http://palbakulich.me/ | http://twitter.com/#!/palhmbs
                    • 38685
                    • 59 Posts
                    I just noticed that this original persons post has....

                    <input name="" type="image" src="assets/templates/fms_v1/images/buttons/but_requestcallback.gif" class="formbutton" />


                    Normally you would just load the vericode like this....
                    [+vericode+]

                    and this would be validated once you hit ’submit’ ..... example code...
                    Please put in the vericode you see below...<br />
                    <img src="[+verimageurl+]" alt="verification code" style="float:left;"/>
                    <input id="vericode" name="vericode" type="text" class="width" style="width: 100px; padding: 0px; margin: 0px;"/>
                    <br />
                    <input name="submit" type="submit" style="width: 100px; height: 25px; margin-bottom: 15px; " value="SUBMIT" /></div>


                    Which the form at http://modxcms.com/forums/index.php/topic,34567.msg210119.html#msg210119 doesn’t seem to be setting...

                    Hope this helps!
                    P.S. If you want a ReCaptcha vericode on your site instead, see this post here...
                    http://modxcms.com/forums/index.php/topic,41869.msg252122.html#msg252122
                      Paul AL Bakulich - Association for Computing Machinery Professional Member
                      http://palbakulich.me/ | http://twitter.com/#!/palhmbs
                      • 18862
                      • 70 Posts
                      Susan - If you get a chance, would you give me a quick rundown on how I could verify that the dummy field is being checked and working? I guess my question is -> what’s the easiest way to pass that field with some information in it so as to trip the snippet and cause it not to email?

                      Thanks!