Validating a form in php bamyan in afghanistan predating
Often, people confuse form validations with form security.
Form security (preventing exploits like SQL injection, XSS attacks etc ) are to be handled in addition to form validation.
For example, if you have set length limit in the database for a text input, it is better to do the validation before it actually gets cut off by the database system or even getting an error thrown.
Form validation is focussed towards the user input where as the security validations should be focused on how you use the data.
When you use the form data in an SQL query, it should be validated against SQL Injection.
We could show more than one message at the same time. https://github.com/EFTEC/Validation One What’s the advantadge of this library or why we are using it: It will read the value “frm_name” from POST.
What if instead of return a boolean, we return an error message? But, what if the user input fails in more than one time at the same time?Then you can just check for ’emptiness’ : For dropdown lists, we are to set the ‘selected’ attribute for previously selected item.