PHP 包含菜单系统 - 重新加载不起作用
我现在的页面非常简单。我使用 PHP 的唯一目的是切换菜单系统。因此,在切换系统中,我检查变量“菜单”以查看它的设置。
例如,如果我加载联系信息,它将是
www.mydomain.com/?menu=contact
在“菜单”下的php开关代码中只有一件事。
包含(“contact.php”);
好吧,我知道这很简单,但我遇到的问题是,当我更改“contact.php”时,浏览器中不会注意到更改,直到我实际直接转到该文件。所以我必须浏览 www.mydomain.com/contact.php 然后我才能看到差异。完成此操作后,我可以返回“www.mydomain.com/menu?contact”并查看差异。
我尝试过在 Firefox、Safari 和 Chrome 中重新加载、刷新和重新加载缓存命令。它们的工作方式都是一样的。我该如何解决这个问题,每次我需要查看更改时刷新两个页面相当耗时。
I have very simple page at the moment. The only thing that I using PHP for is a switch menu system. So in the switch system i check the variable "menu" to see what it's set to.
So for example if i load the contact info it would be
www.mydomain.com/?menu=contact
in the php switch code under "menu" there is only one thing.
include("contact.php");
Ok, I know this is very simple, but the problem that I am having is when i change the "contact.php" the changes won't be noticeable in the browser, not until i actually go directly to that file. So I would have to browse to www.mydomain.com/contact.php and then i see the difference. After doing that I can go back to "www.mydomain.com/menu?contact" and see the difference.
I have tried to reload, refresh and reload cache command in Firefox, Safari and Chrome. They all work the same way. How can I fix this, it's rather time consuming to refresh two pages each time I need to see the changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的系统上是否使用了像 eaccelerator 或 APC 这样的缓存系统(phpinfo(); 会告诉您)。
如果您在需要之前打印模板的
time()
和filemtime()
会发生什么,它应该告诉您上次修改的时间。Are you using a caching system like eaccelerator or APC on your system (phpinfo(); would tell you).
What happens if you print the
time()
andfilemtime()
of the template before requiring it, it should tell you when it was last modified.