Re: [PHP] your method for validating forms

2003-10-01 Thread John W. Holmes
Chris W. Parker wrote: What I'd like to do is get rid of all the if's and what not and throw them into a function. What I thought of doing to replace all this is: $formdata['fname']['data'] = (!empty($_GET['fname'])) ? $_GET['fname'] : "" ; $formdata['fname']['type'] = "name"; $_SESSION['form_e

Re: [PHP] your method for validating forms

2003-10-01 Thread Robert Cummings
InterJinn works something like this for it's FormJinn engine. So I'd say it sounds quite good :) Cheers, Rob. On Wed, 2003-10-01 at 19:43, Chris W. Parker wrote: > Hey people. > > I'm trying to come up with an easy way to validate forms. I've got an > idea and I'd like your feedback as well as s

Re: [PHP] your method for validating forms

2003-10-01 Thread Curt Zirzow
* Thus wrote Chris W. Parker ([EMAIL PROTECTED]): > Hey people. > > > function validateFormData($input) > { > foreach($input as $field) > { > switch ($field['type']) > { > case 'name': > // do the magic >

Re: [PHP] your method for validating forms

2003-10-01 Thread Brad Pauly
On Wed, 2003-10-01 at 17:43, Chris W. Parker wrote: > Hey people. Hey [snip] > What I'd like to do is get rid of all the if's and what not and throw > them into a function. What I thought of doing to replace all this is: > > > $formdata['fname']['data'] = (!empty($_GET['fname'])) ? $_GET['fna

[PHP] your method for validating forms

2003-10-01 Thread Chris W. Parker
Hey people. I'm trying to come up with an easy way to validate forms. I've got an idea and I'd like your feedback as well as suggestions and/or your own methods. My idea is to have a multi-dimensional array with fields: data and type. Let's say you have a form with three fields. First Name (fnam