包含跨所有网页的超链接的标头 [英] Header inclusion with hyper links across all web pages

查看:75
本文介绍了包含跨所有网页的超链接的标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在所有页面中为我的标题进行php包含。



Currently I am doing php inclusion for my header in all pages.

<?php
include "../../common/header/header.php";
?>





其他页面的路径更改,例如。



Above path changes for other page, for eg.

<?php
include "../common/header/header.php";
?>





我的标题包含导航链接其他页面命名为:关于,联系我们和帮助自己的CSS文件。



使用上述方法,导航链接到页面(About.php,Contactu。当使用include语句在其他网页中引用标头时,标头中包含的phps,help.php)保持静态。因此,发生404未找到错误。

我的目录结构是树视图,并且对于每个网页,标题的相对路径发生变化,我如何提供页面链接(about.php,contactus。 php,help.php)在标题本身,以便它在树结构的任何页面中包含标题?



My header includes navigation links to other pages named as: About, Contact Us and Help with a CSS file for itself.

With the above approach, navigation links to pages(About.php,Contactu.phps, help.php) included in the header remains static when header is referenced in other web pages with the include statement. Thus, a 404 not found error occurs.
My directory structure is a tree view and for every web page relative path to the header changes, how can I give links to pages(about.php,contactus.php,help.php) in header itself so that it work on inclusion of the header in any page in the tree structure?

推荐答案

只需通过以下链接< br $> b $ b

http://stackoverflow.com/questions/344823/how-do-i-format-a-php-include-absolute-rather-than-relative-path [ ^ ]



希望它有所帮助。
Just go through the below link

http://stackoverflow.com/questions/344823/how-do-i-format-a-php-include-absolute-rather-than-relative-path[^]

Hope it helps.


这篇关于包含跨所有网页的超链接的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆