TOPIC:

Limit submission per IP not working 2 months 2 weeks ago #250295

  • kzescher
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
I have similar problem. Would you please let me know the solution?

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

Limit submission per IP not working 2 months 2 weeks ago #250296

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

on this link you can find the code for limit submission per IP:
crosstec.org/en/support/online-documenta...-of-submissions.html

Regards,
Tihana

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

Limit submission per IP not working 2 months 2 weeks ago #250297

  • kzescher
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
i face the promble like this:

"..The limit is set to 2, but this is what happen at the third submission:

- He get redirected to the page where are explained the reasons of such limit (this step is the only one that work as it should)
- Such submission unfortunately get recorded in the "managed records".
- Such submission unfortunately get emailed to the user and to the admins..."

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

Limit submission per IP not working 2 months 2 weeks ago #250298

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

go to your form->Advanced->More options->Form pieces->Before form->check Custom->and put this:
$ip=$_SERVER['REMOTE_ADDR'];;
$db = JFactory::getDBO();
$db->setQuery("Select count(id) From #__facileforms_records Where ip ='".$ip."' and form = 999");
if( $db->loadResult() > 2 ){
  // replace index.php with the url to an article explaining that the max. amount has been reached
  header("Location: index.php");
  exit;
}

Please replace '999' with ID of your form->to find the form ID , go to Components > BreezingForms > Manage Forms. You will find the ID number for your form in the Script ID column.

Regards,
Tihana

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

Limit submission per IP not working 2 months 2 weeks ago #250299

  • kzescher
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
HIi..

Thank you for your help. I had found the code and it worked.

But has a little problem -->

"..The limit is set to 2, but this is what happen at the third submission:

- He get redirected to the page where are explained the reasons of such limit (this step is the only one that work as it should)
- Such submission unfortunately get recorded in the "managed records".
- Such submission unfortunately get emailed to the user and to the admins..."

This mean.. if I set the limit to 2(for example), I still can enter the form after 2 submission.
- When I submit, I get redirected to the page which set to notify the limitation. However, this submission would get recorded and get email.
- After the third submission, the code is perfectly work to redirect the page immediately when I enter the form.

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

Limit submission per IP not working 2 months 2 weeks ago #250302

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

this is strange behavior.
What happend if you set it like this:
$ip=$_SERVER['REMOTE_ADDR'];;
$db = JFactory::getDBO();
$db->setQuery("Select count(id) From #__facileforms_records Where ip ='".$ip."' and form = 999");
if( $db->loadResult() > 1 ){
  // replace index.php with the url to an article explaining that the max. amount has been reached
  header("Location: index.php");
  exit;
}
After the second submission, the code should works.

Regards,
Tihana

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

Moderators: ForumSupport
Time to create page: 0.043 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!