<?php
   //http://stackoverflow.com/questions/18382740/cors-not-working-php
include '../comunes_php/cors.php';
include "../comunes_php/Log.class.php"; 
$log = new Log("app_trace", "../");	

$id = intval($_REQUEST['id']);
$nombre = $_REQUEST['nombre'];
$importe = $_REQUEST['importe'];


include 'tabla.php';
include '../rdb/conn.php';

$sql = "insert into $tabla (id,
nombre,importe) values ($id,
'$nombre',$importe)";

@mysqli_query( $conn,$sql);
$log->insert($sql, false, false, false);


echo json_encode(array(
	'id' => mysqli_insert_id($conn),
	'nombre' => $nombre,
	'importe'=> $importe,
	'sql'=>$sql
));

?>