php - require、require_once、include - 页面加载两次
我有一个问题。
我在includes目录中有file1.php - 所以includes/file1.php 另一个文件是 file2.php,它有一个
require(dirname(__FILE__).'/includes/file1.php');
我用 firebug 查看过的文件,而且我还在 txt 文件中写入了一些内容,看起来
I have a question.
I have file1.php in includes directory - so includes/file1.php
Another file is file2.php that have a
require(dirname(__FILE__).'/includes/file1.php');
I've looked with firebug, and also I wrote something into a txt file, and seem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您发现某个页面在您的客户端(即 Firefox(或 Firebug)中)加载了两次,那么您的代码很可能会进行重定向或类似的操作。
如果能在这里看到部分代码,或者至少是您在 Firebug 中看到的内容(如 HTTP 操作/状态代码),那就太好了。
If you see that a page is loaded twice in your client, i.e. in Firefox (or Firebug), you're code does most likely redirect or something like that.
It would be good to see a part of the code here, or at least what exactly you're seeing in Firebug (like HTTP actions / status codes).