hanlonj Posted August 1, 2007 Share Posted August 1, 2007 Hi, I've been doing a good bit with php lately and every site I work on wants their forms validated. Is there any possible way to write a generic form validator even for forms that are completely different? I know this sounds like a weird request but being programmers, aren't we supposed to re-use code. I'm sure you lot do this all the time but can you let me know how you re-use code in this instance? hj Link to comment https://forums.phpfreaks.com/topic/62937-generic-form-validator-with-php/ Share on other sites More sharing options...
Caesar Posted August 1, 2007 Share Posted August 1, 2007 Yes. You can loop through all the posted data (Except the submit button etc...) and clean it, and check it. Link to comment https://forums.phpfreaks.com/topic/62937-generic-form-validator-with-php/#findComment-313375 Share on other sites More sharing options...
hanlonj Posted August 1, 2007 Author Share Posted August 1, 2007 Yes. You can loop through all the posted data (Except the submit button etc...) and clean it, and check it. Can you expand a bit on this please?Do I need to set up everything in the form as an array then? hj Link to comment https://forums.phpfreaks.com/topic/62937-generic-form-validator-with-php/#findComment-313383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.