make <li class =“active”>使所有分页变为活动状态?</li>

时间:2015-01-14 11:01:44

标签: php pagination

我在将页面设置为活动时遇到问题..但是要使所有分页处于活动状态?请参阅代码

  <div id="content">
            <div class="hero-unit-table"> 
                <div id="header">
                    <img src="images/mountains.jpg" width="938" halt="" class="img-rounded">

                </div>
                <div id="body">


                    <h3>List of Our Products</h3>
                    <p>
                    <div class="hero-unit-table"> <div class="container"><ul    class="pagination"><?php 
                    $limit = 8;
                    $sql = "SELECT COUNT(medicine_id) FROM tb_medicines"; 
                    $rs_result = mysql_query($sql);  
                    $roww = mysql_fetch_row($rs_result);  
                    $total_records = $roww[0];  
                    $total_pages = ceil($total_records / $limit);  
                    $pagLink = "<div class='container'><ul class='pagination'>";  
                    for ($i=1; $i<=$total_pages; $i++) {  
                    $pagLink .= "<li><a href='medicines.php?page=".$i."'>".$i."</a></li>"; 

                    };  

                    echo $pagLink . " 
        <input type='text' class='form-control' placeholder='Search...'>
      </ul></div>";  ?></p></ul></div></div>

0 个答案:

没有答案