作者:丨为你 | 来源:互联网 | 2023-09-18 21:09
Ihavethisheader.phpwhichIincludedinallthepagesIneedit.Iused@include_once(header.php
I have this header.php
which I included in all the pages I need it. I used @include_once('header.php');
in order to be able to load the page via AJAX into the "container" div of another page without having to worry about it being showed twice. But since both the main page and the loaded page have the header included, the header is showing twice. I thought include_once
was supposed to not let that happen. What should I do?
我有这个header.php,我把它包含在我需要它的所有页面中。我使用了@include_once('header.php');为了能够通过AJAX将页面加载到另一个页面的“容器”div中,而不必担心它被显示两次。但由于主页面和加载页面都包含标题,标题显示两次。我认为include_once应该不会让这种情况发生。我该怎么办?
1 个解决方案