DEV Community

Discussion on: How To Validate Your Forms Server-Side With Octavalidate-PHP

Collapse
 
frankwisniewski profile image
Frank Wisniewski

it is important to first secure forms on the client side using input types and to check them using form.validate.
I also check the field values on the server side, but I don't issue any error messages, instead I stop processing immediately.
One can assume that faulty data is passed through manipulation. Then why should you care.

Collapse
 
ugorji_simon profile image
Simon Ugorji

Nice implementation, Frank.

But I still feel that the end user needs to know what's wrong with the value he submitted.

Collapse
 
frankwisniewski profile image
Frank Wisniewski

yes, only for user/pass validation with a simple ajax request.

I don't believe in constantly sending complete forms back and forth, that was OK in the noscript days, not anymore.
PHP should return data, nothing else. Processing should be client-side.

Thread Thread
 
ugorji_simon profile image
Simon Ugorji

Great Frank!

This library also has a client side implementation which is slightly impossible to break through because it handles frontend forms validation pretty well.

GitHub logo Octagon-simon / octaValidate

This Library helps to validate your HTML forms using validation rules, sophisticated regular expressions and form input attributes.

octaValidate V1.2.0

This library helps to validate your HTML forms using validation rules, sophisticated regular expressions and form input attributes.

We have included a demo.html file which you can open to see how this library really works.

We have developed this Library to work server-side on PHP language and as such, you can validate your forms server-side using this Library for PHP. Visit the repository

DOCUMENTATION

Visit the DOCUMENTATION to learn more about this GREAT Library!

INSTALL

CDN

Place this script before the </head> tag.

<script src="https://unpkg.com/octavalidate@1.2.0/native/validate.js"></script>
Enter fullscreen mode Exit fullscreen mode

NPM

Visit this Link to the Documentation to learn how to install this Library with NPM.

LOCAL

  • Download and import the latest release to your project.
  • In your project, create a script tag and link the file validate.js.
  • Place the script before the </head> tag.
<script src="octaValidate/src/validate.js"></script
Enter fullscreen mode Exit fullscreen mode

Thank you once again for engaging 🌟