清除浏览器刷新的POST数据 [英] Clearing POST DATA for Browser Refresh

查看:394
本文介绍了清除浏览器刷新的POST数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP优点:


我有一个简单的html表单,将数据提交到php脚本,

处理它,然后重新显示同一页面,但用谢谢

消息代替html表单。这一切都很好。但是,当刷新浏览器时,我会收到以下消息:


"您要查看的页面包含POSTDATA。如果您重新发送

数据,将重复执行该表单的任何操作(例如搜索或在线

purchse)。要重新发送数据,请单击确定。否则,

点击取消。


显然我不希望我的用户向我重新发送数据。

我需要以代码方式执行什么操作,以便在刷新浏览器时重新加载页面,而不会显示此消息。


提前致谢。

PHP Pros:

I have a simple html form that submits data to a php script, which
processes it, and then redisplays the same page, but with a "thank you"
message in place of the html form. This is all working fine. However,
when refresh the browser, I get the following message displayed:

"The page you are trying to view contains POSTDATA. If you resend the
data, any action the form carried out (such as as search or online
purchse) will be repeated. To resend the data, click OK. Otherwise,
click Cancel."

Obviously I don''t want my users to resend the data to me.

What do I need to do code-wise so that when the browser is refreshed,
the page is reloaded without this message being displayed.

Thanks in advance.

推荐答案

tmax写道:
PHP优点:

我有一个简单的html表单,将数据提交给php脚本,然后对其进行处理,然后重新显示同一页面,但用谢谢
消息代替html表单。这一切都很好。但是,刷新浏览器时,我会显示以下消息:

您要查看的页面包含POSTDATA。如果您重新发送
数据,将重复执行表单(例如搜索或在线
purchse)的任何操作。要重新发送数据,请单击确定。否则,
点击取消。

显然我不希望我的用户向我重新发送数据。

我需要做什么代码 - 这样当浏览器刷新时,页面会重新加载而不会显示此消息。

提前致谢。
PHP Pros:

I have a simple html form that submits data to a php script, which
processes it, and then redisplays the same page, but with a "thank you"
message in place of the html form. This is all working fine. However,
when refresh the browser, I get the following message displayed:

"The page you are trying to view contains POSTDATA. If you resend the
data, any action the form carried out (such as as search or online
purchse) will be repeated. To resend the data, click OK. Otherwise,
click Cancel."

Obviously I don''t want my users to resend the data to me.

What do I need to do code-wise so that when the browser is refreshed,
the page is reloaded without this message being displayed.

Thanks in advance.



Don'重定向到表单;重定向到没有表单的摘要页面

或使您的表单页面对


Don''t redirect to the form; redirect to a summary page without the form
or make your form page sensitive to whether the


_POST数据是否可用感到敏感

并且执行不要发出< form>如果
_POST data is available
and do not have it emit a <form> if the


_POST数据可用。


我更喜欢第一种方法而不是第二种方法。


-david-

_POST data is available.

I prefer the first method over the second.

-david-


这篇关于清除浏览器刷新的POST数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆