在我的域根文件夹中,我有header.php和footer.php文件,我在新文件夹中创建了一个新的文件夹和文件,并希望包含main中的页眉和页脚文件。所以路径是:主文件夹:example.com/ header er.php新文件:example.com/文件夹/ new _file.php <- -在这个文件中,我想包含标题。
我试过:
<?php include "header.php"; ?>
<?php include "/header.php"; ?>
<?php include "./header.php
所以我有nav.php
<div>
<!-- and a lot of more code here so thats why i want write it once and include into all pages in main folder but also subfolders
<img src="logo.png">
</div>
主文件夹如下所示:
nav.php
logo.png
index.php
带有secondpage.php的子文件夹
在index.php和主文件夹中的所
include "con.php"会在当前文件夹中找到con.php文件。
include "../con.php"会在上面的文件夹中找到它。
在上面的文件夹2中找到它的语法是什么?
最后,在同一“上面”文件夹中的文件夹中查找它的语法是什么?(就像我有一个主文件夹,里面有foldersONE和两个。con.php在两个文件中,而要运行的文件在一个文件中?
谢谢!