Reputation: 702
I've been using the php include function for my navbar for my website. It works well but.... My HTML says
<?php include 'include/navbar.html'; ?>
Now if I have a HTML page in /techpages/toptech.html
so I would like to change my php include to <?php include 'http://example.com/include/navbar.html'; ?>
. The problem is I get heaps of errors then.
Can someone help me? Can someone answer one of these questions?
../
to go into the parent folder. Is there a CSS equivilant?Any help would be much appreciated.
Upvotes: 1
Views: 969
Reputation: 57124
Here are two approaches which I think will work for what I imagine you are trying to achieve:
Upvotes: 1
Reputation:
One of the options of doing that is:
include($_SERVER['DOCUMENT_ROOT']."/include/navbar.php");
Upvotes: 0