You know, you cannot call directly
PHP
code from
JavaScript
,
PHP
is server side scripting while
JavaScript
runs on the client. What you can do is, from your
JavaScript
function, load another page or reload the same page passing a parameter to let the
PHP
know you need the function call. See, for instance, the following
thread[
^].