I followed a tutorial sometime back and now I want to use this script unfortunately the tutorial at the time did not cover what I am looking for but I did end up with the code below.
I am wanting to have an active class dependant on users selection. I would appreciate any help.
<?php
echo '<ul id="nav">';
$cat_sql="SELECT * FROM administration";
$cat_query=mysqli_query($con, $cat_sql);
// calling data put into associative array
$cat_rs=mysqli_fetch_assoc($cat_query);
do{ ?>
<li><a <?php if ($current_page == "name") { ?><?php } ?>href="index.php?page=<?php echo $cat_rs['link_name']; ?>"><?php echo $cat_rs['name'];
?></a></li>
<?php
} while ($cat_rs=mysqli_fetch_assoc($cat_query));
echo "</ul>";
?>
<!-- need to add - class='active' -->
The code above gets the field names for the buttons but I am unable to work out how to have an active class. The code is messy but have been trying all sorts to sort this.
Thanks again for any pointers/help.