Jump to content

[SOLVED] how to do validation?


chaiwei

Recommended Posts

Hi,

 

May I know how you all do validation for a for a form.

 

Normally we use ctype,filter,preg_match, check_date, is_string, is_?

But if I got a form having 100 of field,

 

It is impossible for me to go and validate all the field whether it is a valid date,

email, string.

 

is there any way to improve the form validation?

 

btw, ctype and filter which one is better?

Link to comment
https://forums.phpfreaks.com/topic/167089-solved-how-to-do-validation/
Share on other sites

You could use a form class to build a form along with the validation. Most php frameworks( such as Zend Framework and CakePHP) include functionality to create forms a lot easier.

 

I do think that having a form with a hundred fields is a bit of an overkill. I mean If I saw a form with a 100 fields I would simply click the back button or some other action to go to another page.

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.