I am currently using WAMP/localhost for development of my site. I did not want to keep having to change my navbar on all of my pages so I moved the navbar into its own file and am using include('navbar.php'). It currently works except for when I have nested folders for example,
WAMP (folder)
--www (folder)
----index.php
----navbar.php
----lab (folder)
------lab1 (folder)
--------q1.php
--------q2.php
When I view question 1, q1, and try to go back to home, index.php, it works. When I try to view q2 from q1 it does not work. Instead it displays, /labs/1/labs/1/2.php. Here is my navbar code that is included on all pages,
<div class="col-md-2 hidden-sm hidden-xs" id="sidebar" role="navigation">
<div class="well sidebar-nav">
<ul class="nav">
<li><a href="/index.php">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Lab 1<b class="caret"></b></a>
<ul class="dropdown-menu" id="sidebar-dropdown">
<li><a href="./labs/1/1.php">Question One</a></li>
<li><a href="./labs/1/2.php">Question Two</a></li>
<li><a href="./labs/1/4.php">Question Four</a></li>
<li><a href="#">sub item</a></li>
</ul>
<!--<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>-->
</ul>
</div><!--/.well -->
</div><!--/span-->
How can I have it work so that when I click on a page within a folder it will load the correct file?