I just solved with the help of Grame_Grant! I had a T insted of t in the inputfield = txtInput.text
this is the final script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DataInserter : MonoBehaviour
{
string CreateGanadoresURL = "http://localhost/trivia/ganadores.php";
public Text factura;
public Text ruc;
public Text nombre;
public string inputFactura;
public string inputRuc;
public string inputNombre;
void Start ()
{
}
void Update ()
{
inputFactura = factura.text;
if (Input.GetKeyDown(KeyCode.Space)) CreateGanadores(inputFactura, inputRuc, inputNombre);
}
public void CreateGanadores(string factura, string ruc, string nombre)
{
WWWForm form = new WWWForm();
form.AddField("facturaPost", factura);
form.AddField("rucPost", ruc);
form.AddField("nombrePost", nombre);
WWW www = new WWW(CreateGanadoresURL, form);
}
}
Grame_Grant many many thanks to you!