Add "active" class
hello,
how are you? hope doing well. I want ask how to add Bootstrap class "active" to dynamic menu? I am attaching the code file
regard
hello,
how are you? hope doing well. I want ask how to add Bootstrap class "active" to dynamic menu? I am attaching the code file
regard
It looks like you are already trying to with:
<?php if (stripos($_SERVER['REQUEST_URI'],'index.php') !== false) {?>active<?php } ?>
Where else did you want to add it? or what isn't working the way you want? I would think code similar to the code you have would work.
Maybe try:
<a class="nav-link <?php if (stripos($_SERVER['REQUEST_URI'],'index.php?name='.$Recordset1->getColumnVal("name")) !== false) {?>active<?php } ?>" aria-current="page" href="index.php?name=<?php echo($Recordset1->getColumnVal("name")); ?>">
<?php echo($Recordset1->getColumnVal("name")); ?>
</a>
sorry for late. its works Thanks but detail page showing same in each page I don't whats wrong in fact code is fine I am sending demo and code
It might be an issue with your .htaccess file not passing the correct name.... ad this to your page:
Showing: <?php echo($_GET["page"]); ?>
If the name doesn't change, then it is probably an issue with your .htaccess
here is .htaccess code
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)?$ index.php?name=$1
That looks correct. I may need to help with this in a premier support ticket. I need to debug your code live to make sure I understand and can fix the problem and the forums won't allow that.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.