Index.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("li91_list");
mysql_query("set names utf8");
$result = mysql_query("select count(*) as c from`qt_account_log`");
$row = mysql_fetch_array($result);
$total = $row['c'];
$pagesize = 10;
$page = ceil($total/$pagesize);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"content="text/html; charset=utf-8" />
<title>Jpaginate</title>
<script type="text/javascript"src="jquery-1.3.2.js"></script>
<script src="jquery.paginate.js"type="text/javascript"></script>
<link rel="stylesheet" type="text/css"href="css/style.css" />
<script>
$(document).ready(function(){
$("#demo").paginate({
count:<?php echo $page;?>,
start:1,
display:10,
border:true,
border_color:'#BEF8B8',
images:false,
mouse:'press',
onChange:function(page){
$("#pagetxt").load("article.php?page="+page);
}
})
})
</script>
</head>
<body>
<divclass="demo">
<div id="pagetxt">
<?php
$result = mysql_query("select log_id,change_time,change_descfrom `qt_account_log` order by log_id desc limit 0,10");
while($row = mysql_fetch_array($result)){
$pubdate = date('Y-m-d',$row['change_time']);
echo"<p><span>$pubdate</span>----$row[log_id]<ahref='view-blog-".$row[log_id].".html'target='_blank'>
".$row[change_desc]."</a></p>";
}
?>
</div>
<divid="demo"></div>
</div>
</body>
</html>
article.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("li91_list");
mysql_query("set names utf8");
$result = mysql_query("select count(*) as c from`qt_account_log`");
$row = mysql_fetch_array($result);
$total = $row['c'];
$pagesize = 10;
$page = ceil($total/$pagesize);
$start = ($_GET['page'] - 1)*$pagesize;
if(isset($_GET['page'])){
$result = mysql_query("select log_id,change_time,change_descfrom `qt_account_log` order by log_id desc limit$start,$pagesize");
while($row = mysql_fetch_array($result)){
$pubdate = date('Y-m-d',$row['change_time']);
echo"<p><span>$pubdate</span>----$row[log_id]<ahref='view-blog-".$row[log_id].".html'target='_blank'>
".$row[change_desc]."</a></p>";
}
}