I have this code, which creates the pages, taken from the DB:
function subject_navigation($connection){
$sqlCommand = "SELECT id, linknavn, pos FROM subjects ORDER BY pos ASC";
$query = mysqli_query($connection, $sqlCommand) or die (mysqli_error());
while ($row = mysqli_fetch_array($query)) {
$sid = $row['id'];
$linklabel = $row['linknavn'];
echo '<li><a href="index.php?sid=' . $sid . '&' . $linklabel . '" title="' . $linklabel . '">' . $linklabel . '</a></li>';
}
mysqli_free_result($query);
}
I have in vain been trying to create a small script that echoes out a selected class, when a page is active/clicked - but without succes.
How can I modify this line, so the active link echoes out the selected css class?
echo '<li><a href="index.php?sid=' . $sid . '&' . $linklabel . '" title="' . $linklabel . '">' . $linklabel . '</a></li>';