I have a menu that displays data fine, the url for the first menu looks like this: http://…com/prehistoric-egypt, and as expected loads the data from the database.
I have ten menu ‘headers’ each with it’s own links to pages. The one mentioned has a ‘header’ and for sub-menu - the header is not a link, just text. The problem occurs when I select a different ‘header’ sub-menu. For example, I have Archaic Period as a sub-menu, so I was expecting the url to be http://…com/archaic-period, but instead I get http://…com/prehistoric-egypt?=archaic-period and does not load the data. The first part after.com/ changes depending on what page I was on first so this could be http://…com/homet?=archaic-period.
I include the html / php code for the menu / sub menu:
<div class="dropdown">
<button class="dropdownButton">Pre 3150 BC</button>
<div class="dropdownContent">
<?php
$q = "SELECT * FROM pages LIMIT 4 OFFSET 5";
$r = mysqli_query($dbh, $q);
while( $nav = mysqli_fetch_assoc($r) ){
echo '<a href="' . $nav['slug'] . '">' . $nav['pagelinks'] . '</a>';
}
?>
</div>
</div><!-- dropdown end -->
</span>
<img src="images/line.png" alt="A Line">
<span class="item">
<div class="dropdown">
<button class="dropdownButton">3150 – 2686 BC</button>
<div class="dropdownContent">
<?php
$q = "SELECT * FROM pages LIMIT 3 OFFSET 9";
$r = mysqli_query($dbh, $q);
while( $nav = mysqli_fetch_assoc($r) ){
echo '<a href="?=' . $nav['slug'] . '">' . $nav['pagelinks'] . '</a>';
}
?>
</div>
</div><!-- dropdown end -->
Pre 3150 BC is the first ‘header’ with calls to load in date to display the links etc.
How do I resolve this issue so I can show the pages I want?
Any help will be appreciated…