<TR bgcolor="#ffffff" align=center>
<TD><a href="content.php?id={成员ID}">{姓名}</a></TD><TD>{性别}</TD><TD>{年龄}</TD><TD>{email}</TD>
</TR>
-------------------content.htm文件-----------------------
复制代码 代码如下:
<HTML>
<HEAD>
<TITLE>成员信息</TITLE>
</HEAD>
<BODY style="font-size:12px">
<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="1" bgcolor=#000000 style="font-size:12px">
<caption>成员信息</caption>
<TR bgcolor="#ffffff">
<TD width=60>姓名</TD><TD>{姓名}</TD></TR>
<TR bgcolor="#ffffff">
<TD>性别</TD><TD>{性别}</TD></TR>
<TR bgcolor="#ffffff">
<TD>年龄</TD><TD>{年龄}</TD></TR>
<TR bgcolor="#ffffff">
<TD>email</TD><TD>{email}</TD></TR>
</TABLE>
</BODY>
----------------index.php文件--------------------------
复制代码 代码如下:
<?php
include("includes/class.inc");
$tmpl =new templet;
$mycon =new mycon;
$con = $mycon->connect();
mysql_select_db("test",$con);
$lim = 20; //每页显示行数
$p = ($_GET[p]) ? $_GET[p] : 1; //当前页号
/***** 生成列表开始 *****/
$lists = "";
$tmpl->get_file("templet/list.htm");
$tags = array("成员ID","姓名","性别","年龄","email"); //应与表字段同顺序
$rs = mysql_query("select * from test order by id desc limit ".($p-1)*$lim.",$lim");
while($row=mysql_fetch_row($rs)){
$lists .= $tmpl->parse($tags,$row);
}
/***** 生成列表完成, 分页开始 *****/
$tmpl->get_file("templet/index.htm");
$rn = @mysql_result(mysql_query("select count(id) from test"),0); //总记录数
$ps = ceil($rn/$lim); //总页数
$pagination = "<a href='?p=1'>首页</a> ";
if($p>1) $pagination .= "<a href='?p=".($p-1)."'>";
else $pagination .= "<font color='#777777'>";
$pagination .= "上一页</font></a> ";
if($p<$ps) $pagination .= "<a href='?p=".($p+1)."'>";
else $pagination .= "<font color='#777777'>";
$pagination .= "下一页</font></a> <a href='?p={$ps}'>尾页</a> ";
/***** 分页完成, 生成页面开始 *****/
$tags = array("所有列表","总条数","每页条数","分页");
$vals = array($lists,$rn,$lim,$pagination);
echo $tmpl->parse($tags,$vals);
?>
---------------- content.php文件 ---------------
复制代码 代码如下: