I've implemented an ajax post function based on a button click. The code is
$.ajax({
type: "POST",
url: "includes/phpscripts?action=manage",
data: {location: loc, lat: latitude, lon: longitude, heading: head, filename: file},
success: function(){
$("#panoInfo").html("<div id='message'></div>");
$("#message").html("Valid Submission");
}
});
I specified the POST method since I don't want the variables to be visible via the URL. However, they are.
My test URL before posting is
http://localhost/JMCTour/buildtour.php
Afterwards
http://localhost/JMCTour/buildtour.php?filename=1-prefix_blended_fused.jpg&location=Start+of+Tour&lat=43.682211&long=-70.450705&heading=100&submit=Save
Why?
Make sure your form tag has method='POST'
<form method='POST'>
...
</form>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With