I have a problem to make a url form navigation active so it light up.
I have this code, but it is not working. It has been a while that I used php and it does not accept anymore if the variable is empty. Can someone help me? This is the code:
<?php
$current1 = ""; $current2 = "";
if (isset($_GET['mode']))
//mode not empty
{
$mode = $_GET[ 'mode'];
echo $mode."<br>";
if ($mode = "index") { $current1 = "active";$current2="";}
elseif ($mode = "contact") { $current2 = "active";$current1="";}
}
else
//mode empty
{
$current1 = "active";$current2="";
}
?>
Perhaps this might be a simpler way: