Possible Duplicate:
Call PHP Function using jQuery AJAX
I have a PHP file containing all functions created by me. I just want to know, how can I call a specific function through Ajax?
Possible Duplicate:
Call PHP Function using jQuery AJAX
I have a PHP file containing all functions created by me. I just want to know, how can I call a specific function through Ajax?
You could pass a get or post variable and use it to then using php call a specific function. WHat exactly are you trying to achieve ?
send the function name through GET method to the php page and then execute _GET value using call_user_func
You could use call_user_func()
:
$name = $_POST['function'];
if (in_array($name, $allowed_functions)) {
$result = call_user_func($name);
}
Although this reeks of bad design. Why do you need to do this?