示例

发表于:2007-06-21来源:作者:点击数: 标签:
? php //if(!$pageID)$pageID=1; include(Pager.php); $params[itemData] = range(1, 180); $pager = $data= $pager-getPageData(); $links = $pager-getLinks(上页,下页); list($from, $to) = $pager-getOffsetByPageId(); ? html body table border=0 widt

   
   <?php
//if(!$pageID)$pageID=1;
include('Pager.php');

$params['itemData'] = range(1, 180);

$pager =& new Pager($params);
$data  = $pager->getPageData();

$links = $pager->getLinks("<<上页","下页>>");
list($from, $to) = $pager->getOffsetByPageId();

?>
<html>
<body>

<table border="0" width="100%">
    <tr>
        <td colspan="3" align="center">
            显示 [<?=$from?> - <?=$to?>] 条记录,共<?=$pager->_totalItems?>条记录 <br />
            <?=$links['pages']?>
        </td>
    </tr>

    <tr>
        <td><nobr><?=$links['back']?></nobr></td>
        <td align="center" width="100%"> </td>
        <td align="right"><nobr><?=$links['next']?></nobr></td>
    </tr>

    <tr>
        <td colspan="3">
            <pre><?print_r($data)?></pre>

        </td>
    </tr>
</table>

</body>
</html>  

原文转自:http://www.ltesting.net