Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
Jquery, AJAX no publica datos

Tengo un problema al enviar algunas matrices y datos a una página, pero no se publica. Intenté print_r($_POST); pero muestra Array () como salida y otros datos tampoco se publican

El guión es el siguiente:

 <script type="text/javascript">

$(documento).on('clic', "#submitr", function(){

 var favorite = []; var tag = []; var type = []; var scheme = []; $.each($("input[name='pcheck']:checked"), function(){ favorite.push($(this).val()); }); $.each($("input[name='tag[]']"), function(){ tag.push($(this).val()); }); $.each($("input[name='type[]']"), function(){ type.push($(this).val()); }); $.each($("input[name='scheme[]']"), function(){ scheme.push($(this).val()); }); var count=$("#count").val(); $.ajax({ type: "POST", url: 'reportr.php', data: { count:count, pcheck:favorite, tag : tag , type : type, scheme : scheme }, success: function() { window.location.href = "reportr.php"; } }); }); </script>

En alerta se están mostrando los valores

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

¿Estás seguro de eso? Tenga en cuenta que está realizando 2 solicitudes a reportr.php , primero una solicitud POST y, cuando tiene éxito, una solicitud GET: la redirección. Solo muestra los resultados de las segundas solicitudes y $_POST estará vacío allí.

Para ver el resultado real de su solicitud POST, debe cambiar la función de success :

 success: function(data) { console.log(data); // window.location.href = "reportr.php"; }

Ahora verá el resultado de reportr.php en la consola de herramientas de desarrollo del navegador.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!