• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Bloody spammers

JackGoa

Member
Hi guys,

Anybody know how to combat idiot spammers without having to install a captcha. I have such a neat little contact form on my home page, don;t want to spoil it now :(
 
Not really a Fabrik question/topic... but...

Code:
<div id="fooDiv">
<label for="foo">Leave this field blank</label>
<input type="text" name="foo" id="foo">
</div>
<script>
(function () {
    var e = document.getElementById("fooDiv");
    e.parentNode.removeChild(e);
})();
</script>

Similar code to the above is commonly used to trip up the majority of bots (which is where the majority of spam comes from) in a non-evasive way for real users. Bots typically cannot determine what fields are required, hidden, etc., so most of the time they fill them ALL in. With the code above - you can almost always assume if it has a value - it's from a spambot. It even has a small "safety" feature in the event a "real" user does not have JS enabled which will display a message to leave it blank.

Enjoy -

Dale
 
ok so i just need to get that into my fabrik form and then validate it to make sure it is empty before the form will submit?

do you know how i can get the div tags around that element in fabrik? i'm guessing the script can be added in the js field?
 
You could try adding a simple field, and a PHP validation of ...

PHP:
return empty($data);

... and a JS event on the element, running onLoad, with this code:

Code:
var container = this.findClassUp('fabrikElementContainer');
container.parentNode.removeChild(container);

I tested that code, and it works, and removes the entire element container from the DOM.

Whether this will work as adevrtized, and bots will still see it and fill it in, I don't know. But worth a go.

Do let me know. This might be an interesting element type to add, something like "honeypot", which has this functionality built in, no need to add code or validations. It would also be nice to have a 'honeypot' validation failure do so "silently", with no feedback, and acting as if the form had submitted.

-- hugh
 
Hi Hugh. Thanks for getting back to me.

I've entered the code exactly as you instructed, and it seems to work.

I just want to be sure I have it right:
- I've added the PHP validation code to the 'PHP Code' field. In the 'Condition' field, the form does not submit. Is that correct?
- There is no 'onLoad' dropdown option for the Javascript, only 'load', I presume that is the correct option to use?]

Now to see if I still get spammed from that form. Will keep you posted on that.
 
Not a Fabrik solution but I have also a contact form on all my sites and get very little spam (typically < 10/year) using the security features of sh404SEF (in the past) and now Admin Tools. They bot protect out of the box from the most common bots, have implementation for the HoneyPot project,...
 
Yeah, I don't really get much spam from my Joomla contact forms. It's just this small Fabrik contact form I've put on my home page that's giving me issues. I'm using Fabrik more and more for these kind of forms to capture leads all over some of my sites and if this solution works, it's going to be great not having to wade through spam all the time.

*so far, no spam. It's only one day though since implementing the above solution. The spam always seem to come in waves. Quiet for a week, then waves and waves of the stuff at a time. My biggest concern is that they're looking for weaknesses in order to run their little "script kiddie vandalistic codes".
 
To answer your previous questions, yes. The 'load' event is the right one. And yes, the PHP Code is the one you want for the vlaidation. The "condition" box is for code that determines whether you actuallyw ant the validation to be applied or not, which you don't need.

Glad this is working. This may well be something I'll add as a plugin, called something like "honeypot".

Meanwhile, it'd be nice to get this in to the Wiki, I'm just not sure which section would be best, any suggestions?

-- hugh
 
Ok cool. I have it all in the right place then. And thanks, now I also understand how that part of Fabrik works.

I would actually like to make a suggestion for the Wiki, if that is in order? What about a Tips, Tricks & Simple Solutions section in the Wiki? I think there are a lot of things that could go in such a section. As a very bottom level intermediate coder, I sometimes find it incredibly hard to find answers to things that I know are very simple to do with Fabrik. And it oftens feels like the info in the Wiki, and even answers that I get from fellow forumites are more aimed towards seasoned developers that understand coding at a much more advanced level.
I know what I want to do most of the time, just don't know how to bend Fabrik to my will. If there was a section like this, I would be able to look at other examples and get clues from that.

PS, glad your op was a success. Hope you heal up fast.
 
Of course it's in order. :) The wiki is there for the community.

I definitely think that's a good idea. How would you see that being structured? Just a simple, single section, or sub-categorized in some way?

-- hugh
 
Maybe sub-categories can be added as it grows? It would be hard to say from the "get go" what kind of items might end up being published there. For example, the solution above would probably be considered as something to do with mail or spam, whereas a tip on adding Google Conversion Tracking to a button would be a different category all together.
 
Sure, that's the beauty of a wiki, it can grow and change with whatever the community finds useful.

I'd say to start with that getting as specific as "email spam" probably isnt the way to go. I'd think more along the lines of "Tips for forms", "Tips for lists", etc.

Then if we find we start to accumulate enough more specific content, the categories can be shuffled aorund as appropriate.

-- hugh
 
You could try adding a simple field, and a PHP validation of ...

PHP:
return empty($data);

... and a JS event on the element, running onLoad, with this code:

Code:
var container = this.findClassUp('fabrikElementContainer');
container.parentNode.removeChild(container);

I tested that code, and it works, and removes the entire element container from the DOM.

Whether this will work as adevrtized, and bots will still see it and fill it in, I don't know. But worth a go.

Do let me know. This might be an interesting element type to add, something like "honeypot", which has this functionality built in, no need to add code or validations. It would also be nice to have a 'honeypot' validation failure do so "silently", with no feedback, and acting as if the form had submitted.

-- hugh

I have used this little trick for quite some time and it worked really well. Over time, I changed the javascript to:

JavaScript:
jQuery(this.element).closest('.fabrikElementContainer').remove();

It seems either these clever bastards have figured this one out, or, it does not work anymore. I'm not sure which? Does it look in order?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top