0
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>
$current page Give me something like this back parameter=algumacoisa
What I would like to know is if there is a way for the href link in 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 catch the L4 who is in href="? L4"
Is there a way to do that?
It’s not giving to understand very well, so I figured you want to take the value of href and compare in if dynamically is this? if it is possible only with javascript
– Felipe Duarte
exactly: I need to print the value of href="" dynamically in $page Current==LINK_DO_HREF. In Javascript, can tell me how to do?
– Carlos Rocha