FormBuilder Help Needed Input Fields

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
gallowstree_merlin
New Member
New Member
Posts: 8
Joined: Fri Aug 11, 2006 6:59 pm

FormBuilder Help Needed Input Fields

Post by gallowstree_merlin »

I am attempting to use a form in FormBuilder as input to populate a MYSQL database table.  I have been able to then use FormBrowser to populate the FormBrowser's table in the database.  I do not want to use this method as this puts the data into the table in a way that needs a lot of manipulation to format it for the output I want.  A flat structure table would best suit my needs.

I really want to pass the input variables to a User Defined Tag so that I can use a SQL query to INSERT them into the database table.  However I do not have sufficient (hardly any) php or Smarty knowledge to properly access the fields.  Have spent hours attempting this.  Once I can properly access the fields and their values I can write the query to insert the field values into the database.

Need clear guidlines on how to pass the fields input to the UDT either when calling it or how to access them from the UDT.

My input fields from the FormBuilder submission template are:

$date} / {$fld_66} date
{$town} / {$fld_67} town
{$venue} / {$fld_68} venue
{$address} / {$fld_69} address
{$venue_phone} / {$fld_70} venue_phone

Any help would be great

Alan
Last edited by gallowstree_merlin on Fri Jul 06, 2007 11:39 pm, edited 1 time in total.
.... as we know, there are known knowns; there are things we know we know.

We also know there are known unknowns; that is to say we know there are some things we do not know.

But there are also unknown unknowns - the ones we don't know we don't know.

DR 12 Feb 2002
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

Re: FormBuilder Help Needed Input Fields

Post by musicscore »

I used CTLModuleMaker (if you used this module you love it) and created the following udt to write data from an Formbuilder-form to the database (mysql) :

global $smarty;
$tpl_vars = $smarty->get_template_vars();

global $gCms;
$db = &$gCms->GetDb();

$naam = $tpl_vars['naam'];
$email = $tpl_vars['email'];
$...... = $tpl_vars .......


$query = "INSERT INTO (database_table_naam) (name, email, .....) VALUES ('$naam', '$email', '$......')";
$db->Execute($query);

ATTENTION: You have to add a field in the form to use the udt AND the send the form to an e-mail or file.

The combination CTLModuleMaker and Formbuilding really Rocks
Thanx to people who build the modules.

Musicscore
Post Reply

Return to “CMSMS Core”