Podrias usar Jquery
Código PHP:
Ver original<?php require_once('Connections/conexion.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_section_lang = "-1";
if (isset($_GET['id_lang'])) { $colname_section_lang = $_GET['id_lang'];
}
$query_section_lang = sprintf("SELECT mc_section_lang.id, mc_section_lang.id_section, mc_section_lang.id_lang, mc_section_lang.section_lang FROM mc_section_lang WHERE id_lang = %s AND id_section >3", GetSQLValueString
($colname_section_lang, "int")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>menu</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function()
{
$(".links").click(function()// en evento click de cada enlace con la clase .links
{
$(".links").removeClass("active");//quito la clase active de todos los demas links
$(this).addClass("active");// añado la clase active al enlace clickeado
});
})
</script>
<style type="text/css">
.active {
font-style: italic;
font-weight: bold;
text-transform: uppercase;
color: #F00;
text-decoration: none;
}
</style>
</head>
<body>
<div id="submenu">
<ul>
<?php do { ?>
<li><a class="links" href="?id_section=<?php echo $row_section_lang['id_section']; ?>&id_lang=<?php echo $row_section_lang['id_lang']; ?>"><?php echo $row_section_lang['section_lang']; ?></a></li>
</ul>
</div>
</body>
</html>
<?php
?>