Hi, I saw somewhere I can't remember a use validating a registration form using array[], errors .. something like that but did not use if/else statements. The errors were constructed in arrays. Anyway, what is a neat way validating inputs? thanks
You can build yourselve a function that does all the work for you, as i have done many times! and insert it with a to check array with variables. In my case the array looked something like this. $a = array('fieldtocheck' => array('min' => 10, 'max' => 100, 'type' => 'numeric'), 'fieldtocheck1' => array('type' => 'email'), 'fieldtocheck2' => array('type' => 'regex', 'value' => 'regexstring')); Code (markup): etc
Hello eritrea1, This may be of some use. It's a downloadable universal php form validator script with instructions. Hope it helps. http://www.downloadeasyphpscripts.com/universalphpformvalidatorscript.html
You might think about using AJAX for forms validation. Do a Google search on "php ajax form validation" for more info. A little more to it, but a better user experience.