We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14352
    • 9 Posts
    Hello all,

    Question
    I am planning on using the following method to prevent spammers submitting comments. In my Jot-form i have a field (input) wich is hidden by css. When submitted it should remain empty. A php-snipppet should check if the input is empty. But a bot doesnt see it is hidden and fills it with spam. When the bot submits it, the php-snippet should prevent it being submitted. More about this method can be found here: Fighting Spam with CSS

    Sottwell implemented this method in her eform contactform. She explained how she did this here: http://modxcms.com/forums/index.php/topic,25391.0.html
    Sotwell mentioned it isnt waterproof, but it should at least stop some spam-bots.

    The (hidden) input in my case formatted this way:
    ######### XHTML #########
    
    	<label id="Lastname">Do <strong>not</strong> fill in this field!<br />
    	<input type="text" name="Last__Name" size=30 />
    	</label>
    
    ######### CSS #########
    	#Lastname {
    background-color:red;
    height:1px;
    width:1px;
    top:-500px;
    left:0;
    overflow:hidden;
    position:absolute;
    text-decoration:underline;
    }
    


    As you can see, the label is hidden from public with CSS. If someone happens to have a CSS-disabled browser they see the message not to fill it in. Bots should not be so smart to find out its hidden..

    this is the snippet he uses (called: checkField) :
    <?php
    function checkField(&$fields,&$vMsg,&$rMsg) {
        if(!empty($fields['Last__Name'])) {
            return false;
        } else {
        return true;
        }
    }
    ?>


    and the eform call (the relevant part)
    [!eForm? &formid=`Form` [...] &eformOnValidate=`checkField`!]


    However, I want to use this method for Jot. I can not find a parameter similar to &eformOnValidate to run the snippet for Jot.
    So my question is: How to run the snippet when the form is submitted, but before it is placed.
      • 14352
      • 9 Posts
      bump, anyone havin a thought or solution on this? Since this really is a nice and pretty effective anti-spam method..
        • 7231
        • 4,205 Posts
        You would need to hack the Jot script to add this function (I think). It would be great if Jot had an event setup like eForm, it would make it easy to add custom antispam methods. If you do gt into this, look into using bobRay’s modMollom class for spam protection, I would like to see this integrated with Jot at some point.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 14352
          • 9 Posts
          thx for the reply dev_cw, ill let u know if i find a solution..
            • 15859
            • 12 Posts
            Did anyone get this to work? It would be great!
              • 14352
              • 9 Posts
              I gave up on this (limited by my PHP knowledge) so I didn’t. I still believe this is useful though, since everywhere where I’m using this method for contact forms (eform) noone recieves spam.
                • 15859
                • 12 Posts
                Hmm, i found this http://bigbuddymedia.com/eliminate-spam-in-modx-eform-without-captcha, to bad Jot makes all fields entered in &validate, required. It should have this: &validate and &required
                  • 16278
                  • 928 Posts
                  Just adding http as a "badword" in Jot is pretty effective at preventing auto-publication of spam. Nearly every spam comment includes some full URLs, either as proper HTML or as BB-code with square brackets. Even if you want to allow entry of addresses, most humans start off with www rather than the full http: address. For contact forms, SEO is another bad word, white hat or otherwise.

                  I use a blacklist check so that known spammers don’t even get offered an input form with Jot, but you need to contribute a honey pot to the project to get an API key for the list I use - see http://wiki.modxcms.com/index.php/Spamproofing_for_Jot. This aproach has the advantage that some of the bots stop coming when they don’t see any forms. Meanwhile one of my honey pots is at an address that ceased to have a guestbook on it three years ago, but still gets plenty of return visits!

                  smiley KP
                    • 15859
                    • 12 Posts
                    Thanks kp52 for the input! I was looking into the badwords thing just now, but could only think of this:
                    [url][/url]
                    which i saw in a spam yesterday. http, seams like a good addition.
                      • 15859
                      • 12 Posts
                      Mmmmmmmm, this is really nice, gives me a warm feeling inside. I tried the badwords thing but then everything gets f**ked up. This site i’m working on seams to hate everything that has to do with Jot. I can’t use placeholders http://modxcms.com/forums/index.php/topic,61418.0.html and can’t fix the server offset time on Jot comments http://modxcms.com/forums/index.php/topic,34055.0.html and now i can’t stop spam....what the f**k?
                      UPDATE Maybe i should explain the badwords problem. If i insert &badwords=`http` and &bw`1` in the jot call, every post gets unpublished whatever word i fill in, not just "http".