Custom form fields

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
commie_hero
Forum Newbie
Posts: 1
Joined: Fri Jul 24, 2009 7:49 am

Custom form fields

Post by commie_hero »

I'm making a very lightweight CMS for my personal use. I want to make a tab that lets me create forms that people on the front-end can fill out.

I suppose the question is how do you store a "form" in a database and retrieve all of its values later.

This is more or less a "custom form fields" implementation.
Bruno De Barros
Forum Commoner
Posts: 82
Joined: Mon May 12, 2008 8:41 am
Location: Ireland

Re: Custom form fields

Post by Bruno De Barros »

In my opinion, a Form Generator class would do the trick. If you had a Form Generator, you'd be able to create forms with it at will, and then just serialize the object and store it in the database. This would be the easiest way, in my opinion.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Custom form fields

Post by alex.barylski »

Store data in a generic value and a schema like:

Code: Select all

pkid, formid, name, value
Post Reply