I have successfully implemented a Bootstrap Menu by placing it in a separate header.html file and using the php include function to call that file on every page of my website. However, I am now trying to figure out how to dynamically change the active class based on the page that has been loaded.
<header class="header_area">
<div class="main_menu">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="./index.php">
<img src="./Images/Test Logo Image.png" width="35" height="35" alt="" loading="lazy">
</a>
<a class="navbar-brand Company_Text hidden-lg" href="./index.php">Dolphin Rubber Udyog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<div class="mr-auto"></div>
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="./index.php">Home<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="./about.php">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./products.php">Products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./contact.php">Contact Us</a>
</li>
</ul>
</div>
</nav>
</div>
</header>