I currently have a standard hyperlink with two query strings to send to a PHP form seen below:
echo ' <strong>(<a id="cancel-upgrade" href="unsubscribe.php?cu='.$payRef.'&su='.$stripe_subscription_id.'">Cancel upgrade)</a></strong>';
The only way I know how to send data via AJAX is:
$.post('process-payment.php', $("form#payment-form").serialize(), function (data) {
if (data == "success") {
...something
else {
Something else
}
});
Is there anyway to use the link I have currently and use the query string data, via AJAX, to the PHP form and act on the success/error messages received?