Execute PHP function on button click

Execute PHP function on button click

janosh0610janosh0610 Posts: 1Questions: 1Answers: 0

Hi
I would like ask if it is possible to execute a server-side PHP custom function by clicking custom button on client side?
If yes, could you provide code snippet?

In my case, the PHP function would do some sql inserts and updates, and then the datatable should get updated with the new values.

Best regards and many thanks!
Janosh

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    Its certainly possible - have the button's click event listener call $.ajax() to make a call to the server, and specifically the PHP script you want to execute.

    Allan

This discussion has been closed.