Answers for "get current page name for page active class"

PHP
0

get current page name for page active class

<?php
$url = basename($_SERVER['PHP_SELF']);
?>
//nav bar
<li  <?=  ($url === "dashboard.php") ? "class='active'"?>><a href='dashboard.php'> Dashboard</a></li>
<li <?= ($url === "bankdetails.php")? "class='active'"; ?>><a href="bankdetails.php"> Bank Account Details</a></li>
Posted by: Guest on May-23-2021

Code answers related to "get current page name for page active class"

Browse Popular Code Answers by Language