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

112
Views
Trying to do ajax post to php to store in mysql

The code I'm testing is this:

<!DOCTYPE html>
<html>
  <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  </head>
    <title>Fetch POST Data</title>
    <body>
    <button onclick="sendData('6');">Release By Date</button>
<div><p id="mypar">Output Here</p></div>
<script>

function sendData(myval) {
 document.getElementById("mypar").innerHTML="You have clicked on "+myval;
var FormData = new FormData();
FormData.append("myclick", myval);
$.ajax({
  type: 'POST',
  url: 'https://www.agfilmanalytics.com/upload.php',
  data: {myclick: '6'},
  datatype: 'text',
  success:function(response)
  {alert(response);}
  }
);
}
</script>
</body>
</html>

Trying to post to this and get a response:

<?php

$myval = $_POST['myclick'];
echo "I got it ".$myval;
}

I get nothing back, I know if I can get the info to php I can put it into MSQL but thus far, nothing seems to be happening. I realize that the button in the HTML really doesn't do anything, but I was testing to get it to send to php with some value, even if it wasn't passed from the code above.

about 4 years ago · Juan Pablo Isaza
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!