Home > DeveloperSection > Forums > common elements php html navbar
Samuel Fernandes
Samuel Fernandes

Total Post:159

Posted on    April-10-2013 2:20 AM


 1 Reply(s)
 1504  View(s)
Rate this:
Hi Everyone!

I am trying to make a template for my website. Basically taking out all the common 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 to the css files.

Can anyone tell what I'm doing wrong here? i'm using xampp and have tried with both relative and absolute paths- (include '../navigation.php' and 'localhost/folder/navigation.php')

Thanks in advance!


Total Post:604

Posted on    April-15-2013 7:52 AM

Hi Samuel!

Try using something along the lines of this to link to your header/footer files:

and then appropriately link to your .js/.css files within header.

Don't want to miss updates? Please click the below button!

Follow MindStick