I have 3 links that all point to the same page but to different sections.
This is what the page sections look like, they are all similar- just read from different tables.
<h1>Networking</h1>
<?php
include 'inc/connect.php';
$data = mysqli_query($link, "SELECT * FROM networking WHERE id = 1")or
die(mysqli_error($link));
while($info = mysqli_fetch_array( $data )) {
echo nl2br($info['info']);}
?>
</article>
This is the part of the menu file that has a link to 'Networking'.
if ($page == 'system') {
$output .="<li><a href='system.php#networking' class='active'>Networking</a></li>";}
else{
$output .="<li><a href='system.php#networking'>Networking</a> </li>";}
All the page section are in a page called system.php. In the head of system.php I have this line
<?php $page = 'system'; ?>
This so I can apply the css class 'active' to the active link.
The way it is now, when I click on any 1 of my same page different section link the the class 'active' is applied to all 3 menu items.
Is there a way that I can apply the class to only the clicked link?