• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to stop submiting query in a form

#11
[eluser]johnpeace[/eluser]
Yeah, I don't see it as an either/or. Redirecting to the form submission acknowledgement page is certainly a common and acceptable technique for handling form submissions.

My approach is more about data integrity and fraud prevention.

BTW I don't usually redirect to the acknowledgement screen. My form submission logic is more like:

- if all of the conditions are met to allow insert/email
- do the insert email
- dislplay the acknowledgement template/view
- if not due to form validation fail
- display the form/validation errors
- if not due to an unwanted submission
- display the 'thanks but we don't want that submission' template/view

No redirects, just a selective display of views/templates...just how I've been doing it lately.

#12
[eluser]DarkManX[/eluser]
i was using such path to solve it before i used ci (and recently laravel, rly nice framework). the best way to get rid of such redundant emails you just send form data to the email sending method, send the email, redirect to the form page again attaching flash-message and form data to the redirect. this way you can repop the form in case of failure or just display the success message. that a rly nice elegant way to validate forms and trigger sideeffects


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.