Execute PHP without leaving page

后端 未结 3 780
难免孤独
难免孤独 2021-01-06 13:34

I have a form - textarea (named su) and submit button.

When the form is submitted, I need to

  1. run a PHP script without refreshing/leaving
3条回答
  •  花落未央
    2021-01-06 13:45

    It is usually best to use a Javascript library for doing AJAX.

    See jQuery.get() for one way to send a request to a PHP web page using the jQuery library. You can have your PHP page output Javascript to be executed, or output plain text or data.

提交回复
热议问题