send $_POST data via anchor tag

后端 未结 4 1326
夕颜
夕颜 2021-01-07 16:00

is it possible to somehow send $_POST[] data via a tag? because it seems to automaticly execute the $_POST[] once the page l

4条回答
  •  醉梦人生
    2021-01-07 16:32

    Nothing in HTML will cause a link to trigger a POST request or encode data in the request body.

    You can bind a JavaScript event handler to a link, cancel the default behaviour and then send a POST request by programmatically submitting a form or using XMLHttpRequest. This generally isn't a good idea and you should use a submit button instead (which you can style to look like a link if you really, really want to).

提交回复
热议问题