---
title: "common elements php html navbar"  
description: "common elements php html navbar"  
author: "Samuel Fernandes"  
published: 2013-04-10  
updated: 2013-04-15  
canonical: https://www.mindstick.com/forum/758/common-elements-php-html-navbar  
category: "html5"  
tags: ["html5"]  
reading_time: 1 minute  

---

# common elements php html navbar

Hi Everyone!\
I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to make a [template](https://www.mindstick.com/blog/282/creating-custom-template-in-joomla) for my website. Basically taking out all the [common](https://www.mindstick.com/articles/23170/10-most-common-accounting-mistakes-of-small-business) stuff out using php's include function.\
I have made a navigationbar.php and samplepage.php. navigationbar has all the links to stylesheets etc. When they are in the same folder and I include navigationbar.php in samplepage it works just fine.\
However when i move samplepage.php to a subdirectory (leaving navigationbar.php in the same folder) and link navigationbar.php with the menu doesn't come formatted. it seems samplepage is getting contents from navigationbar.php but navigationbar is not [linking](https://www.mindstick.com/forum/12882/how-to-linking-different-elements-together) to the css files.\
Can [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) tell what I'm [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp) here? i'm using xampp and have tried with both [relative and absolute paths](https://www.mindstick.com/forum/160361/how-to-use-relative-and-absolute-paths-when-importing-modules-in-javascript)- (include '../navigation.php' and 'localhost/folder/navigation.php')\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!\

## Replies

### Reply by AVADHESH PATEL

Hi Samuel!\
Try using something along the lines of this to link to your header/footer files:\
include($_SERVER['DOCUMENT_ROOT'].'/path_to/header.php');and then appropriately link to your .js/.css files within header.


---

Original Source: https://www.mindstick.com/forum/758/common-elements-php-html-navbar

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
