Welcome Guest, Not a member yet? Register   Sign In
Fatal error: memory exhausted in form validation
#9

[eluser]Kobus M[/eluser]
Hi guys,

Thanks for everyone that tried. I found my problem, and I am not 100% sure whether what I do is good or bad (comments please), but at least the problem is fixed.

I am leaning towards BAD, because at school. I learned that a function should have a single purpose. But I have since then read a few variations on that topic. Okay - herewith the details...

Here is how I do things usually (1 functions more than one possible outcome):

1. 1 controller/function performs the template display AS WELL AS the processing of the form (check if the form is submitted)
2. If submitted, then do something, if not submitted, then show the form
3. Function name is for example User/register (controller/function).

I have now split these functions (1 function for each outcome):

1. 1 controller function performs the template display (i.e., User/register).
2. 1 controller function performs the logic and form processing (i.e., User/register_submit).

When these functions are split up, I do not get the memory exhausted problem any more. I guess it is the check whether the form was submitted that caused an endless loop of some sort with the form_validation.

I believe that this ended up being my error, but I am marking it as a solution in the event that someone else finds themselves in this same situation.

Thanks for trying!

Kobus


Messages In This Thread
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 07:15 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 07:25 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 07:43 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 07:58 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 08:34 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 10:26 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-13-2012, 01:52 PM
Fatal error: memory exhausted in form validation - by El Forum - 12-14-2012, 11:43 AM
Fatal error: memory exhausted in form validation - by El Forum - 12-28-2012, 07:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB