最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php+ajax分页代码
时间:2008-05-24 编辑:简简单单 来源:一聚教程网
page.php代码.
class class_page
{
private $record_count, $perpage;
private $page_count, $page_current;
function __construct($perpage, $record_count, $page_current)
{
$this->perpage = $perpage;
$this->record_count = $record_count;
$this->page_count = ($record_count == 0) ? 1 : ceil($record_count / $perpage);
$this->page_current = ($page_current > $this->page_count) ? 1 : $page_current;
}
function __get($name)
{
switch($name)
{
case 'page_count':
return $this->page_count;
case 'page_current':
return $this->page_current;
case 'record_start':
return ($this->page_current - 1) * $this->perpage;
}
}
}
header('Content-Type: text/xml; charset=gbk');
$page = new class_page(20, 150, is_numeric($_GET['page']) ? $_GET['page'] : 1);
echo '';
echo '
echo '
echo '
echo '
echo '
?>
-
上一个: 创建文件夹
-
下一个: php生成xml文件
相关文章
- php ajax分页代码 10-09
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24