Run a PHP function upon button click?

前端 未结 8 1664
小鲜肉
小鲜肉 2021-01-03 04:24

I want to run a PHP function with an HTML button click.

I can call a PHP script this way:

Name
8条回答
  •  孤城傲影
    2021-01-03 04:47

    This won't work. PHP is pretty much done processing by the time the user handles the page. You'd have to use AJAX to send the data to the server and retrieve the response.

提交回复
热议问题