Hey Guys,
I have copied over the same eFrom2DB code I use on another site and its not working.
I get this message above the form:
Parse error: syntax error, unexpected T_PRIVATE in /home/moon/public_html/manager/includes/document.parser.class.inc.php(770) : eval()’d code on line 21
And when I click the forms button I get:
Fatal error: Call to undefined function eForm2db() in /home/moon/public_html/assets/snippets/eform/eform.inc.php on line 377
Here is the code I use:
[!dbUpload!]
[!eForm? &noemail=`true` &formid=`dbForm` &eFormOnBeforeMailSent=`dbUpload` &tpl=`dbForm`!]
And the snippet
<?php
function dbUpload( &$fields )
{
global $modx;
// Init our array
$dbTable = array();
$dbTable[name] = $fields[name];
$dbTable[date] = $fields[date];
$dbTable[rate] = $fields[rate];
$dbTable[net] = $fields[net];
// Run the db insert query
if ($fields[type]==Private)
{
$dbQuery = $modx->db->insert($dbTable, 'customers' );
}
else $dbQuery = $modx->db->insert($dbTable, 'wotif' );
return true;
}
?>
What have I buggered up?
Or maybe is this site missing some php plugin etc?