简体   繁体   English

PHP页面—缓存问题

[英]PHP Page — Cache Issue

(Text below updated based on some of the responses ...) (下面的文字根据一些回复进行了更新...)

I have done some looking online and not found an answer that makes sense to me, so before someone says this has already been answered, please have patience and read the whole thing. 我已经在网上进行了一些查找,但没有找到对我有意义的答案,因此在有人说这已被回答之前,请耐心并阅读全部内容。

I have a PHP page that outputs a standard HTML form. 我有一个输出标准HTML表单的PHP页面。 The form works fine. 该表格工作正常。 The issue that comes up is the processing page ("ProcessThis.php" or whatever). 出现的问题是处理页面(“ ProcessThis.php”或其他内容)。 If a user has used this page once, and their browser is caching pages, the next time they use it, fill out the form, and submit to "ProcessThis.php", they get a 404 error. 如果用户使用过此页面一次,并且浏览器正在缓存页面,则下次使用该页面时,填写表格并提交给“ ProcessThis.php”,则会收到404错误。 This seems to happen if the user has bookmarked the page for the form and comes to it from the bookmark. 如果用户已将表单页面添加为书签,并通过书签进入页面,则似乎会发生这种情况。 If they use the browser's refresh button before filling out the form, that seems to clear the issue. 如果他们在填写表格之前使用浏览器的“刷新”按钮,似乎可以解决问题。

I am fairly sure this is a cache issue, but I am not 100% positive. 我相当确定这是一个缓存问题,但我不是100%积极。 What does seem to help is when the form page loads, having the person use the refresh button on their browser. 似乎有帮助的是,当表单页面加载时,让用户使用其浏览器上的“刷新”按钮。

I have done some searching and all the information I can find on refresh (the PHP refresh() function, and meta tags and all that) is that this causes a loop (refresh every "n" seconds). 我做了一些搜索,在刷新(PHP refresh()函数和meta标记等所有内容)上可以找到的所有信息是,这会导致循环(每“ n”秒刷新一次)。 What I need to do I think is find a way to clear the cache for this, rather than refreshing the page every "n" seconds. 我想做的是找到一种清除缓存的方法,而不是每隔“ n”秒刷新一次页面。 I am kind of at a loss on this ... my "google-fu" is failing me, perhaps and I am using the wrong search options. 我对此感到有点茫然……我的“ google-fu”使我失望,也许是我使用了错误的搜索选项。 Hints, suggestions, etc. would be useful. 提示,建议等将很有用。 Thanks. 谢谢。

The form itself (as a couple of people have asked for the code) is fairly complex, and I am not sure posting the whole thing is useful. 表单本身(有些人要求提供代码)非常复杂,我不确定发布整个内容是否有用。 It's basic HTML form tags ... the actual form tag that starts the form is this (really basic): 这是基本的HTML表单标签...启动表单的实际表单标签是这样(真的很基本):

<FORM METHOD="POST" ACTION="ProcessCourtReportForm.php">

This now falls into the "never mind" category. 现在,这属于“没关系”类别。 It turns out that the people having the problem were linking to an older copy of the form (which I had forgotten to delete from the server) which was still available, but I had deleted the process page from the server, so the 404 Error was real, because the page being looked for really didn't exist. 原来,有问题的人都链接到仍旧可用的表单的较旧副本(我忘记从服务器上删除了该表单 ,但该副本已从服务器上删除,因此出现404错误实际,因为要查找的页面确实不存在。 They have been instructed to modify the bookmarks in their browsers, and I removed the older php file for the form to avoid this issue in the future. 他们被指示修改浏览器中的书签,并且我删除了该表格的旧php文件,以避免以后再出现此问题。 D'oh. 天啊

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM