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.