form definitions in mysql
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

form definitions in mysql

From: zach <zach@dontspamonme.net>
Date: Mon May 01 2006 - 04:24:23 CEST

I just took over a web site that implements input forms in a clever way: all
form definitions are centrally managed in a mysql table. For example, when a
page needs to build an input form that asks for name, ssn, dob, etc, it gets all
of the rows in the form table that has a form id of (n). Each of these rows has
the field size, display order, caption, post name, etc. for the name, ssn, dob,
etc inputs. There is also a function column that can call a php function for the
field display info (e.g., if a field is a pick list that is populated by a
select.) There are some obvious advantages of managing forms in this manner,
since if one needs to hide a field, lengthen it, change the caption, change the
order, add a field, or whatever, one modifies the forms table and not the web
page(s).

Perhaps this is not an uncommon technique, but I haven't come across it before.
Has anyone seen this methodology described, either in print or on the web?

Thanks -

zach
Received on Mon May 1 03:08:19 2006