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

210
Vistas
Undefined index, jQuery var to php var with ajax

Aloha everyone out there! I've been searching around for hours, trying all different kind of $.ajax setups and all that.

But all i can get is an "Undefined index" error. At the moment, im using this while trying to pass the var from my script.js, to conInfo.php

$.ajax({
 url: 'conInfo.php',
 type: 'POST',
 data: {'data': 1},
 success: function (data) {
    console.log(data);
 }
});

And inside of my conInfo.php

<?php
 $value = $_POST['data'];
 echo $value;
?>

And this site is required within my index.php, with the connected script.js Thanks partypeople.

over 4 years ago · Santiago Trujillo
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