Following the instructions here:
http://wiki.modxcms.com/index.php/Use_eForm_to_Store_data_into_Database I created the following snippit:
<?php
function storeReasons( &$fields )
{
global $modx;
// Init our array
$dbTable = array();
$dbTable[firstName] = $fields[firstName];
$dbTable[lastName] = $fields[lastName];
$dbTable[email] = $fields[email];
$dbTable[reason] = $fields[reason];
// Run the db insert query
$dbQuery = $modx->db->insert($dbTable, 'modx_fot_reasons' );
return true;
}
?>
saved it as "reasonSnippit" and put these two lines in a new resource:
[!reasonsSnippit!]
[!eForm? &noemail=`true` &formid=`reason_form` &eFormOnBeforeMailSent=`storeReasons` &tpl=`reason_form` &thankyou=`1`!]
When I go to test it I get this error:
Fatal error: Call to undefined function storeReasons() in C:\xampplite\htdocs\projects\fot2009\assets\snippets\eform\eform.inc.php on line 377
Can someone please explain where I went wrong?