简体   繁体   English

php 包含未在浏览器刷新时显示?

[英]php include not showing on browser refresh?

I have a lengthy nav bar which I've added to nav.php and I include it on each page to save time on editing, however I've noticed that if I refresh the page with an included nav.php upon the refresh the nav.php isn't being reloaded with the browser.我有一个很长的导航栏,我已将其添加到 nav.php 中,并将其包含在每个页面中以节省编辑时间,但是我注意到,如果我在刷新导航时使用包含的 nav.php 刷新页面.php 没有被浏览器重新加载。

Anyone know why this might be or a possible way around it?任何人都知道为什么会这样或可能的解决方法吗?

Thanks.谢谢。

Use include('path_to_file') function in PHP.在 PHP 中使用include('path_to_file')函数。

<html>
   <head>
   </head>
   <body> 
      <?php include('path_to_file/nav.php'); ?>
   </body>
</html>

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

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