HowTo MyBB1.X.X [1.8][1.6] Stop Forum Spam Registration with a Hidden Field (1 Betrachter)

  • Ersteller des Themas
  • #1

Zero00m

Forum-Mitglied
Black-Market: 0 / 0 / 0
8 Januar 2019
319
31 %
Tested with 1.6 but should be the same for 1.8

This will pretty much stop all Spam Registrations.

I got the idea from this post: http://www.returnondigital.com/blog/how-...ng-captcha

What this does is add an invisible field. If anything gets entered into that filed, Registration is declined.

At the moment Spambots struggle with recognizing required fields and reading CSS. So they tend to fill in all empty fields. Doesn't matter if the field is hidden or required.

Because of this, this technique is extremely effective at preventing spam registrations.

To start go to:

Admin CP, Template & Styles > Templates > (your template) > member_register


And find:


{$requiredfields}

None



Above this enter:



<input id="this_title" type="text" name="this_title" value="" />

None



You should end up with something that looks like this:



</fieldset>
<input id="this_title" type="text" name="this_title" value="" />

{$requiredfields}
{$referrer}

None



Save the changes then go to:



Admin CP, Template & Styles > Themes > (your template) > global.css > Edit Stylesheet: Advanced Mode



Then add:



#this_title{display:none;}

None



To the very top (this will hide the field from normal users).



Then save the changes.



Next download global.php from the root of your MyBB install.



Open global.php with a text editor and find:



<?php

None



Now add this directly under it:





$this_form_spam = $_POST['this_title'];
if ($this_form_spam == "")
{
// process the form and send email
}
else
{
die();
}

None



So what you end up with is something like this:





<?php
$this_form_spam = $_POST['this_title'];
if ($this_form_spam == "")
{
// process the form and send email
}
else
{
die();
}
/**
  • MyBB 1.6
  • Copyright 2010 MyBB Group, All Rights Reserved
*
*
* $Id$
*/

$working_dir = dirname(FILE);

None



Once edited upload global.php to the root of your MyBB install.





Now if any spam bots enter anything into the invisible field the Registration will be declined.





I have also added:



<input id="this_title" type="text" name="this_title" value="" />

None


To my Contact Us and Donate templates.​
 
Zuletzt von einem Moderator bearbeitet:
Reactions: d0c
Themenstarter Ähnliche Themen Forum Antworten Datum
Zero00m HowTo MyBB SEO Guide – Make a MyBB SEO Friendly Forum MyBB How-to 0

Dieses Thema betrachten gerade (Benutzer: 0, Gäste: 1)