title: How do active class on pagination
body: <p>I'm trying to active class on list </p>
  
  <p>Kindly if any one can help me to add <code>class="active"</code> on displayed pagination page:</p>
  
  <pre><code>$perpage= $conf['perpage'];
  if (isset($_GET["page"])) { 
      $page  = $_GET["page"]; 
  } else { 
      $page=1; 
  }; 
  $start_from = ($page-1) * $perpage; 
  $result = "SELECT * FROM topics LIMIT $start_from, $perpage"; 
  $result = mysql_query ($result); 
  $n = 0;
  while ($row = mysql_fetch_array ($result)){
      echo '&lt;tr&gt;';
      echo '&lt;td&gt;'.$row['topic_no'].'&lt;/td&gt;';
      echo '&lt;/tr&gt;';
      ++$n;
  }
  
  
  $sql = "SELECT * FROM topics"; 
  $result = mysql_query($sql); 
  $total_records = mysql_num_rows($result);  
  $total_pages = ceil($total_records / $perpage); 
  echo '&lt;ul class="pagination"&gt;'; 
  echo "&lt;li&gt;&lt;a href='topics.php?page=1'&gt;".'&lt;'."&lt;/a&gt;&lt;/li&gt; ";  
  
  for ($i=1; $i&lt;=$total_pages; $i++) { 
      echo "&lt;li  &gt;&lt;a href='topics.php?page=".$i."'&gt;".$i."&lt;/a&gt;&lt;/li&gt; "; 
  }; 
  echo "&lt;li&gt;&lt;a href='topics.php?page=$total_pages'&gt;".'&gt;'."&lt;/a&gt; &lt;/li&gt;"; 
  
  echo '&lt;/ul&gt; ';
  </code></pre>
  
  <p>Thanks in Advance</p>