Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
Data not sending from XMLHttpRequest

I have an XMLHttpRequest with which I want to send a string, but it receives array(0) in the alert, before with x-www-form-urlencoded and without stringify it worked but it didn't receive the data in the post, but now not even that , but I have read that it is how it should be done to send a string, then I leave you the JS and the .php so you can see it, thank you very much in advance :)

var img = chartR.toDataURL("image/png");
document.getElementById('base64').value = img;
var xhttp=new XMLHttpRequest();
xhttp.onreadystatechange = function() {
    if (xhttp.readyState == XMLHttpRequest.DONE) {
        alert(xhttp.responseText);
    }
}
xhttp.open("POST", base_url_admin+"record/reporte", true);
xhttp.setRequestHeader("Content-type", "application/json");
let data = JSON.stringify({"resultChartImg": img});
xhttp.send(data);
$resultChartImg = $_POST;
var_dump($resultChartImg);exit();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda