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

208
Views
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
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!