“警告:页面已过期”在击中“返回”时IE中出现错误。按键 [英] "Warning: page has expired" error in IE when hitting "back" button

查看:151
本文介绍了“警告:页面已过期”在击中“返回”时IE中出现错误。按键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分类广告网站,并且在发布新分类用户时填写一个表格。然后他们点击提交按钮,出现一个验证页面,显示他们已经填写的内容,如果看起来不错,用户点击确定按钮,并分类发布。



下面是一个简短的例子:

 < form action =verify.phpname = main_form等等

然后从verify.php中,如果分类看起来不错,它们就OK了,发布。
然而,在这里他们可以点击后退来改变某些东西,这就是我的问题所在。



现在,在底部main_form,我有文件上传工具,刷新每个上传页面。这是导致问题的原因。然而,我现在要将它更改为非刷新文件上传为时已为时太晚(例如ajax)。

不管怎样,问题是如果用户已上传文件并提交页面,验证页面打开。所以从这里后退按钮只显示警告:页面已过期,而不是显示带有图片上传的表单。

然而,用户可以按F5键刷新)来刷新浏览器,表单会再次出现,但这不是一个好的解决方案。



我该如何解决这个问题?



以及其他浏览器怎么没有这个问题,他们实际上回去并显示完整的形式与图像?

如果没有图片上传,后退按钮在IE中运行正常。



如果您需要更多输入,请告诉我...



BTW;在IE8中没有测试过。

解决方案

see: Chris Shiflett:如何避免页面已过期警告


I have a classifieds website, and when posting a new classified users fill out a form offcourse. Then they hit the submit button, and a "verify" page appears which displays what they have filled out, and if it looks good, the users hit the "ok" button and the classified is posted.

Here is a short example:

  <form action="verify.php" name="main_form" etc

Then from verify.php if the classified looks good, they hit OK, and it is posted. However, here they have the option of clicking "back" to change something, which is where my problem comes in.

Now, at the bottom of the main_form, I have file-upload tool, which refreshes the page for each upload. This is what is causing the problem. However, it is too late for me to change it to a non-refreshing file-upload now (ajax for instance).

Anyways, the problem is that IF the user have uploaded a file and submits the page, the verify page opens. So from here the back button only displays a "Warning: page has expired" instead of showing the form with the images uploaded.

However, users are able to press F5 (refresh) to refresh the browser and the form will appear once again as it was, but this is no good solution.

How can I fix this?

And how come other browsers don't have this problem, they actually go back and display the full form with the images?

Also, offcourse, if no images are uploaded, the back button works fine in IE.

If you need more input let me know...

BTW; NOT TESTED IN IE8 YET.

解决方案

see: Chris Shiflett: How to Avoid "Page Has Expired" Warnings:

Recap

To avoid "Page Has Expired" warnings, set session.cache_limiter to private, and make sure that any form using the POST method submits to an intermediate processing page that redirects the user to a different URL.

这篇关于“警告:页面已过期”在击中“返回”时IE中出现错误。按键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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