I am familiar of how to get ajax to go to a php page an execute a series of things and then return json data. However is it possible to call a specific function which reside
For AJAX request
Include jQuery Library in your web page. For e.g.
Call a function on button click
While click on button, call create function in JavaScript.
On the server side test.php file, the action POST parameter should be read and the corresponding value and do the action in PHP and return in JSON format e.g.
$registration = $_POST['registration'];
$name= $_POST['name'];
$email= $_POST['email'];
if ($registration == "success"){
// some action goes here under php
echo json_encode(array("abc"=>'successfuly registered'));
}