I'm making a CMS with PHP just as practice and want to give a user the ability to create custom form fields that can be used on their website's signup/registration (similar to SocialEngine or PHPFox). However I really don't have a good idea as to how I am going to accomplish this. Would I have to make some sort of plugin ("hook") system? I originally had this in mind but I don't know if this is really a good way to go:
The admin of the CMS would be given a form with the options of the form field's name that they want to create, the type of field(string, boolean, date etc.), the category of the field and whether or not it is a required field.
The values would then be passed into a database table called "custom_form_fields" with the columns: id, field_name, field_type, category, required.
Also to store the values of these fields; a column would be added to the 'users' table where all the user's data is stored.
ALTER TABLE users ADD the_custom_form_field_name datatype
But now I'm confused about how I would display the different form fields in PHP and how I would insert that data from the form fields into the user's table.
If you don't understand my question please look at: http://www.phpfox.com/features/custom-fields/ It shows what I am trying to achieve.
Can anyone help me out with this?
Thanks