Jump to content

Server Side Validation


kwdelre

Recommended Posts

Everything I search is very different and old.

 

Well, everything will be different based upon the particular needs of the validation taking place. Not everyone would validate, say, a phone number or date in the same way. YOU need to decide what data is valid for each field and build(find) the appropriate code.

 

However, as an overall "process" for validation I will suggest that you validate ALL data for errors before determining the post is invalid. All too often I submit a form to be told that field #1 was invalid. When I fix that and resubmit I get an error that field #2 is invalid.

I feel the same way.

 

I keep running into deprecated code in the examples I can find through searches.

 

I'm pretty good about being able to find the code to customize what I am doing. But like you mentioned I need the "overall" understanding first.

 

Any sources out there current?

http://www.php.net/manual/en/book.filter.php

 

Builtin into PHP: functions to validate and to sanitize several data formats: url, email, string, numeric etc.

 

I guess this is the reason you don't find anything new about validation anymore: everyone should be using these filters...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.