Welcome Guest, Not a member yet? Register   Sign In
Form Validation
#10

(08-05-2015, 12:08 AM)iamthwee Wrote: Thanks. The reason why I would like to use redirect is NOT because of resource efficiency.

Purely because it makes the code more readable. It would only be one line to maintain.

So any examples using redirect would be greatly appreciated. Or would you have to use flash data?

In theory, you could probably do this by setting session data, but not only would you be misusing redirect and wasting resources, the scaffolding you would be rebuilding to support the redirect (instead of using the form_validation library and related helper functions) would be significantly more difficult to maintain and read than the alternative. In other words, a redirect is more readable and maintainable only because you haven't done what would be necessary to make it work properly. It's also a waste of the end user's resources, not just your server's resources, because the redirect forces the browser to make another request.
Reply


Messages In This Thread
Form Validation - by ignitedcms - 08-04-2015, 11:11 AM
RE: Form Validation - by mwhitney - 08-04-2015, 01:36 PM
RE: Form Validation - by Diederik - 08-04-2015, 03:02 PM
RE: Form Validation - by ignitedcms - 08-04-2015, 03:40 PM
RE: Form Validation - by Diederik - 08-04-2015, 10:36 PM
RE: Form Validation - by ignitedcms - 08-05-2015, 12:08 AM
RE: Form Validation - by mwhitney - 08-05-2015, 07:26 AM
RE: Form Validation - by Diederik - 08-05-2015, 01:43 AM
RE: Form Validation - by Wouter60 - 08-05-2015, 06:50 AM
RE: Form Validation - by CroNiX - 08-05-2015, 07:20 AM
RE: Form Validation - by ignitedcms - 08-05-2015, 11:55 AM
RE: Form Validation - by mariek - 08-14-2015, 08:40 AM
RE: Form Validation - by mwhitney - 08-14-2015, 09:54 AM
RE: Form Validation - by mariek - 08-17-2015, 12:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB