English:
I have the need to send the form data to an email as both an external database but I get the following error:
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in C:\xampp\htdocs\joomla\components\com_forme\forme. php(193) : eval()'d code on line 1
and the line of the problem is this:
eval($form->script_process);
if(!empty($processform)){
$errors = false;
$form_data = $processform;
$row->uip = $_SERVER;
$row->date_added = date('Y-m-d H:i:s');
$_SESSION = array();
I use the code that I place in "Script called on form process" and the following:
if (isset ($ _POST )) {
$database2 = $database;
$database2 = new database( 'host', 'user', 'password', 'db', 'prefix(if any)' );//comment this line if you're using the same db where the rsform tables are
$database2->setQuery("INSERT INTO `my_external_table` (`firstname`,`lastname`,`email`,`phone`,`city`,`country`) VALUES ('{$processform}', '$processform', '$processform', '$processform', '$processform', '$processform')");
$database2->query();
}
I hope I can help with this problem, thank you very much to all.
---
Spanish:
Datos del formulario en un correo electrónico y en base de datos externa
Tengo la necesidad de enviar los datos del formulario tanto a un correo como a una base de datos externa pero me sale el siguiente error:
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in C:\xampp\htdocs\joomla\components\com_forme\forme. php(193) : eval()'d code on line 1
y la linea del problema es esta:
eval($form->script_process);
if(!empty($processform)){
$errors = false;
$form_data = $processform;
$row->uip = $_SERVER;
$row->date_added = date('Y-m-d H:i:s');
$_SESSION = array();
el codigo que uso lo ubico en "Script called on form process" y el el siguiente:
if (isset ($ _POST )) {
$database2 = $database;
$database2 = new database( 'host', 'user', 'password', 'db', 'prefix(if any)' );//comment this line if you're using the same db where the rsform tables are
$database2->setQuery("INSERT INTO `my_external_table` (`firstname`,`lastname`,`email`,`phone`,`city`,`country`) VALUES ('{$processform}', '$processform', '$processform', '$processform', '$processform', '$processform')");
$database2->query();
}
espero me puedan ayudar con este problema, muchas gracias a todos.