Pattatharasu N Pattatharasu N - 11 months ago 39
Ajax Question

Store active list selection after reloading the page

I need to make sure the list item is selected even after the page gets refreshed. Here's the code:

li a.selected
color: red;

<li><a href="arasu.php?something_dynamically">test</a></li>
<li><a href="arasu.php?something_dynamically">test 1</a></li>
<li><a href="arasu.php?something_dynamically">test 2</a></li>


If I understood your question correctly, you might want to try something like that :

  <li><a href="arasu.php?item=1" <?php if($_GET['item'] == 1):?>class="active"<?php endif;?>>test</a></li>
  <li><a href="arasu.php?item=2" <?php if($_GET['item'] == 2):?>class="active"<?php endif;?>>test 1</a></li>
  <li><a href="arasu.php?item=3" <?php if($_GET['item'] == 3):?>class="active"<?php endif;?>>test 2</a></li>