[!addinv!] [!eForm? &to=`[email protected]` &ccsender=`1` &formid=`itinv` &eFormOnBeforeMailSent=`addinv` &tpl=`itinventory` &report=`invRep` &subject=`IT Inventory Form` &thankyou=`invThanks`!]
<?php
function addinv( &$fields )
{
global $modx;
// Init our array
$dbTable = array();
$dbTable[date] = $fields[date];
$dbTable[location2] = $fields[location2];
$dbTable[bldgnumb] = $fields[bldgnumb];
$dbTable[aptnumb] = $fields[aptnumb];
$dbTable[techname] = $fields[techname];
$dbTable[email] = $fields[email];
$dbTable[rfirstname] = $fields[rfirstname];
$dbTable[rlastname] = $fields[rlastname];
$dbTable[inventorytype] = $fields[inventorytype];
$dbTable[other] = $fields[other];
$dbTable[itemnumb] = $fields[itemnumb];
$dbTable[wonumb] = $fields[wonumb];
$dbTable[comments] = $fields[comments];
// Run the db insert query
$dbQuery = $modx->db->insert($dbTable, 'invdb' );
return true;
}
?>This question has been answered by randall. See the first response.
$dbTable[comments] = $modx->db->escape($fields[comments]);