Home > Backend Development > PHP Tutorial > PHP提交到自身页面怎么方式刷新提交

PHP提交到自身页面怎么方式刷新提交

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:15:47
Original
990 people have browsed it

PHP提交到自身页面如何方式刷新提交
form提交给自身页面,刷新后会重复提交,如何防止?
------解决思路----------------------
可以写个js

把我发的你改改

<script language="javascript"><br />function window.onload()<br />{<br />if(window.name==""){<br />window.name = "0";<br />}<br />else{<br />window.name = eval(window.name) + 1;<br />alert("已经刷新"+ window.name+'次');<br />}<br />}<br /></script>
Copy after login

------解决思路----------------------
下面的方法采用的是屏蔽法:  
  <script> <br /> //禁止用F5键 <br /> function document.onkeydown() <br /> { <br /> if ( event.keyCode==116) <br /> { <br /> event.keyCode = 0; <br /> event.cancelBubble = true; <br /> return false; <br /> } <br /> } <div class="clear"></script>

Related labels:
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