Home  >  Article  >  Backend Development  >  javascript - PHP How to solve the problem of repeated submission of form on refresh page??

javascript - PHP How to solve the problem of repeated submission of form on refresh page??

WBOY
WBOYOriginal
2016-12-01 00:25:401270browse

How does PHP solve the problem of repeated submission of forms when refreshing the page?? What needs to be done? ?

Reply content:

How does PHP solve the problem of repeated submission of forms when refreshing the page?? What needs to be done? ?

commit id

Add a hash to judge

Use session to generate a hash value when rendering the page, and then submit the hash value for comparison when submitting. If it is inconsistent, it will be submitted again.

checkToken

Just add version control. It is a very simple function. For example, many java frameworks provide it, and big php also has it, such as the yii2 framework

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn