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

I dont see how a redirect saves you resources, perhaps i dont quite understand you. After your controller decides a form is not valid you can:
A) load the original form view file and populate it with the posted data and show an error why it was not valid
B) redirect to another url, another controller has to be loaded and some other view file.

I dont see how B would be more efficient.

But if you feel that performace is effected by A you could use both server-side and client-side validation. Then you can asume most users input is being validated on the client side and the server side is just a formality wich should pass straigt away for all regular nice userrs which use javascript or html5 validation.

I prefer to first make things work nicely with server-side validation and if thats done I implement javascript for better user experience since js can validate alot faster.

But the main point is to never trust user input, just like you read in every book about securing a php application.
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