TOPIC:

Prevent certain types of entry in form fields 1 month 4 days ago #263811

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1161
  • Karma: 2
  • Thanks: 61
Hi,

hmm, it is weird, I will test it on my server and let you know the result, please give me a little time.

Regards,
Mirko

Please Log in or Create an account to join the conversation.

Prevent certain types of entry in form fields 1 month 4 days ago #263812

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 7376
  • Karma: 3
  • Thanks: 527
Hi,

we found another code which you can set in Begin submit:
$this->execPieceByName('ff_InitLib');
$value1 = ff_getSubmit('nameofelement');

if( preg_match("/(http|www|<|>|.ru|href|https)/",$value1)){
echo 'Wrong';
exit();
}
Please replace nameofelement with name of your element in which you want to stop spam

If you want to check this in two form elements then like this:
$this->execPieceByName('ff_InitLib');
$value1 = ff_getSubmit('nameoffirstelement');
$value2 = ff_getSubmit('nameofsecondelement');

if( preg_match("/(http|www|<|>|.ru|href|https)/",$value1)){
echo 'Wrong';
exit();
}
if( preg_match("/(http|www|<|>|.ru|href|https)/",$value2)){
echo 'Wrong';
exit();
}

Let us know if you need more help

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Prevent certain types of entry in form fields 1 month 4 days ago #263815

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1161
  • Karma: 2
  • Thanks: 61
Hi,

this is another solution, you can test it
In begin submit:
$this->execPieceByName('ff_InitLib');

$noSpam = array("www","http","anotherwords");

$element=ff_getSubmit('a');
$element1=ff_getSubmit('b');

$checkFields = array($element,$element1);
foreach ($checkFields as $Fld){
if (in_array ($Fld, $noSpam)) {
   echo 'wrong';
   exit();
}
}

I tested it on my server and it works!

Regards,
Mirko

Please Log in or Create an account to join the conversation.

Last edit: Post by Mirec.

Prevent certain types of entry in form fields 1 month 4 days ago #263816

  • dido
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 50
  • Thanks: 0

Mirec wrote: Hi,

$noSpam = array("www","http","anotherwords");

shure that its not must >>array('www','http','anotherwords');


btw the other script which youve send before works fine and has the charme kick them out of the page :D

Please Log in or Create an account to join the conversation.

Prevent certain types of entry in form fields 1 month 4 days ago #263817

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1161
  • Karma: 2
  • Thanks: 61
Hi,

I'm glad that works for you! :)

yes, I need to refine my script, to works as we want!
Thank you for the test, and to told me where is bug! :)

If you need more help, let us know!
Regards,
Mirko

Please Log in or Create an account to join the conversation.

Last edit: Post by Mirec.

Prevent certain types of entry in form fields 1 month 4 days ago #263818

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 1161
  • Karma: 2
  • Thanks: 61
Hi,

I'm corrected a little my script and now should work well.
Script is :
$this->execPieceByName('ff_InitLib');

$noSpam = "/(http|www|<|>|.ru|href|https)/";
$element=ff_getSubmit('a');
$element1=ff_getSubmit('b');
$checkFields = array($element,$element1);
foreach ($checkFields as $Fld){
if( preg_match($noSpam, $Fld)){
echo 'wrong';
exit();
}
}

One of more solutions here. :)

Reagrds,
Mirko

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.053 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!