• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Form data in an email and external database

Form data in an email and external database 10 years 10 months ago #23238

  • decars
  • decars's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
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.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!