TOPIC:

Spam - how to check empty field with PHP ? 2 weeks 2 days ago #258012

  • FiftyNineDesign's Avatar Topic Author
  • FiftyNineDesign
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
Hello team Crosstec,

i need a suggestion how to do a serverside validation for the message field of a form.
It my not be empty, that should be possible, right?

We`re already using the build in JS Filters, they cannot prevent these spammers,
so we would like to add a PHP Solution, please help.

Greetings

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

Spam - how to check empty field with PHP ? 2 weeks 2 days ago #258014

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 5361
  • Karma: 3
  • Thanks: 383
Hi,

you can do server side validation in your form->Advanced->More options->Submi pieces->Begin Submi pieces like this:
$this->execPieceByName('ff_InitLib');
$value1 = ff_getSubmit('elem1');
if($value1 == 'I\'m a bot'){
echo 'We don\'t like spam in element 1!!!';
exit();
}
Please replace elem1 with name of your element in which you want to prevent spam ( not title).

If you element can't be empty then test it like this:
$this->execPieceByName('ff_InitLib');
$value1 = ff_getSubmit('elem1');
if($value1 == ''){
echo 'Wrong! Field can't be empty!';
exit();
}

Let me 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.

Spam - how to check empty field with PHP ? 2 weeks 2 days ago #258022

  • FiftyNineDesign's Avatar Topic Author
  • FiftyNineDesign
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
Hi Tihana,
thank you, i `ll use this, how can i test it?
Deactivate the JS Filters, and then use the form?

Greetings

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

Spam - how to check empty field with PHP ? 2 weeks 2 days ago #258025

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 5361
  • Karma: 3
  • Thanks: 383
Hi,

yep, then this this code in form->Advanced->More options->Submit pieces->Begin Submit

Regards,
Tihana

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.048 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!