I need to run a PHP code from external server when user clicks a link. Link can\'t lead directly to PHP file so I guess I need to use AJAX/jQuery to run the PHP? But how can I d
You can do this with an ajax request too. The basic idea is:
Considering, this as the markup
Test
JS
$("#link").on("click", function() {
$.get("runcode.html", { "id" : ID }, function(data) {
//on success
});
return false; //stop the navigation
});