Home > Backend Development > PHP Tutorial > php防止刷新交付

php防止刷新交付

WBOY
Release: 2016-06-13 13:20:10
Original
1000 people have browsed it

php防止刷新提交
怎样防止刷新页面时,再次提交数据到数据库?

------解决方案--------------------
通过session来判断
------解决方案--------------------
你是要防止表单重复提交? 那就用js做啊。
------解决方案--------------------
提交表单用onclick来触发,去掉默认的submit...
------解决方案--------------------
简单的方法是通过session来判断,也可以通过token
------解决方案--------------------
使用session来控制。

在form的页面,设置一个session,放在一个form field里。submit后,检验session是否和form field一样。用完后,把session的值改变。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template