I have the code below
<?php $paginaCorrente = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY); ?>
<ul class="menu">
<li><a href="?l1" <?php if ($paginaCorrente=="l1") echo class='linkVisitado'";?>>Link 1</a></li>
<li><a href="?l2" <?php if ($paginaCorrente=="l2") echo "class='linkVisitado'";?>>Link 2</a></li>
<li><a href="?l3" <?php if ($paginaCorrente=="l3") echo "class='linkVisitado'";?>>Link 3</a></li>
<li><a href="?l4" <?php if ($paginaCorrente=="l4") echo "class='linkVisitado'";?>>Link 4</a></li>
</ul>
$ pageCurrent returns something like this parameter = something
What I would like to know is if there is a way to link the href in the href itself so that instead of doing
<a href="?l4" <?php if ($paginaCorrente=="l4") echo "class='linkVisitado'";?>>Link 4</a></li>
I do:
<a href="?l4" <?php if ($paginaCorrente==LINK_DO_HREF) echo "class='linkVisitado'";?>>Link 4</a></li>
In the above case I need to get the l4 that is in href="? l4"
Is there a way to do this?