phpcms 单网页 分页 各位大虾!小弟现在正在学习phpcms,遇到一个问题!就是单网页内容太多的话!如何在单网页中分页! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以在文章中手动添加分页识别码,然后通过ajax实现分页也可以通过函数设定一次出了多少字后,截取,再通过ajax分页 各位大虾!小弟现在正在学习phpcms,遇到一个问题!就是单网页内容太多的话!如何在单网页中分页!是page.html哦!用了很多方法都不行!望大虾给予帮助!需要实例!可发到[email protected]!!!!!!!!!!!!!!!!!!! <table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolordark="#ffffff" bgcolor="#BDDEA5"> <tr bgcolor="#e4e4e4"> <td width="5%" height="25" align=center valign="middle" bgcolor="#D5EAC6"><strong>编 号</strong></td> <td width="12%" align=center valign="middle" bgcolor="#D5EAC6"><strong>业务人员性名</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>总客户数</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>成交客户数</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>成交率</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>意向客户数</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>潜在客户数</strong></td> <td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>操 作</strong></td> </tr> <?php $pagesize=18; //定义每页显示多少条记录 $page=isset($_GET["page"])?intval($_GET["page"]):1; //定义page的初始值,如果get 传过来的page为空,则page=1, $total=mysql_num_rows(mysql_query("select id from $table where u_companyid='$companyid'")); //执行查询获取总记录数 $pagecount=ceil($total/$pagesize); //计算出总页数 if ($page>$pagecount){ $page=$pagecount; // 对提交过来的page做一些检查 } if ($page<=0){ $page=1; // 对提交过来的page做一些检查 } $offset=($page-1)*$pagesize; //偏移量 $pre=$page-1; //上一页 $next=$page+1; //下一页 $first=1; //第一页 $last=$pagecount; //末页 $sql=mysql_query("select * from $table where u_companyid='$companyid' order by id desc limit $offset,$pagesize"); if ($total==0){?> <tr bgcolor="#ffffff"> <td height="22" colspan="12" align=center>数据库里还没有数据!</td> </tr> </table> </td></tr> <? } ?> <? while ($rs=mysql_fetch_array($sql)){ $c_userid=$rs["id"]; $sqlu=mysql_query("select * from crm_customer where c_userid='$c_userid'"); $nums = mysql_num_rows($sqlu); $sql0=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=0"); $nums0 = mysql_num_rows($sql0); $sql1=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=1"); $nums1 = mysql_num_rows($sql1); $sql2=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=2"); $nums2 = mysql_num_rows($sql2); if ($nums2<>0 || $nums1<>0 || $nums0<>0 ){ $customer2=round($nums2/$nums,2)*100;} ?><tr bgcolor="#ffffff" onMouseOver="this.bgColor='#EBF4E3';" onMouseOut="this.bgColor='#FFFFFF';"> <td height="21" align="center"><?=$rs["id"]?></td> <td align="left"><a href="List_Customer.php?userid_sale=<?=$rs["id"]?>"><?=$rs["u_xingming"]?></a></td> <td align="center"><?=$nums?></td> <td align="center"><?=$nums2?></td> <td align="center"><div style="height:3px;width:80px;border: 1px solid #49AA00;text-align: left;vertical-align: middle; font-size:6px;"> <div style="height:3px;width:<?=$customer2?>%;background-color: #49AA00;font-size:6px;"></div> </div><?=$customer2?>%</td> <td align="center"><?=$nums1?></td> <td align="center"><?=$nums0?></td> <td align="center"> <a href="User_Update.php?id=<?=$rs["id"]?>&page=<?=$page?>">修改</a></td> </tr> <? }?> <tr> <td width="100%" height="30" colspan="8" bgcolor="#FFFFFF"> 页次:<? echo $page." / ".$pagecount?> 每页<font color="#FF0000"><?=$pagesize?></font> 条记录 总计<font color="#FF0000"><?=$total?></font> 条记录 <? for($k=1;$k<=$pagecount;$k++){ echo " <a href=?page=".$k."><b>".$k."</a></b>";}?></td> </tr> </table> 找熟悉Second life web应用程序开发的人帮忙 PHP中Ucenter问题 求解一个PHP执行页面的方法 iis里面访问php文件出现这样的情况 第一天上班,经理给了个关于phpcms的总站与子站问题让我解决 PHP with GUI 之难 【zeed加密的php文件 验证如何取消掉 】求大神啊附完整代码文件 插入数据用UNIQUE好呢还是插入前用count(*)查询效率高?? thinkphp超链接问题 kafka编译报错,付报错信息,求指点 我的网页中为什么无法播放mpg格式视频 jpgraph 有点儿问题 一经解决 马上上分!!!!
也可以通过函数设定一次出了多少字后,截取,再通过ajax分页
<tr bgcolor="#e4e4e4">
<td width="5%" height="25" align=center valign="middle" bgcolor="#D5EAC6"><strong>编 号</strong></td>
<td width="12%" align=center valign="middle" bgcolor="#D5EAC6"><strong>业务人员性名</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>总客户数</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>成交客户数</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>成交率</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>意向客户数</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>潜在客户数</strong></td>
<td width="8%" align=center valign="middle" bgcolor="#D5EAC6"><strong>操 作</strong></td>
</tr>
<?php
$pagesize=18; //定义每页显示多少条记录
$page=isset($_GET["page"])?intval($_GET["page"]):1; //定义page的初始值,如果get 传过来的page为空,则page=1,
$total=mysql_num_rows(mysql_query("select id from $table where u_companyid='$companyid'")); //执行查询获取总记录数
$pagecount=ceil($total/$pagesize); //计算出总页数
if ($page>$pagecount){
$page=$pagecount; // 对提交过来的page做一些检查
}
if ($page<=0){
$page=1; // 对提交过来的page做一些检查
}
$offset=($page-1)*$pagesize; //偏移量
$pre=$page-1; //上一页
$next=$page+1; //下一页
$first=1; //第一页
$last=$pagecount; //末页
$sql=mysql_query("select * from $table where u_companyid='$companyid' order by id desc limit $offset,$pagesize");
if ($total==0){?>
<tr bgcolor="#ffffff">
<td height="22" colspan="12" align=center>数据库里还没有数据!</td>
</tr>
</table>
</td></tr>
<? }
?>
<? while ($rs=mysql_fetch_array($sql)){
$c_userid=$rs["id"];
$sqlu=mysql_query("select * from crm_customer where c_userid='$c_userid'");
$nums = mysql_num_rows($sqlu);
$sql0=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=0");
$nums0 = mysql_num_rows($sql0);
$sql1=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=1");
$nums1 = mysql_num_rows($sql1);
$sql2=mysql_query("select * from crm_customer where c_userid='$c_userid' and c_quality=2");
$nums2 = mysql_num_rows($sql2);
if ($nums2<>0 || $nums1<>0 || $nums0<>0 ){
$customer2=round($nums2/$nums,2)*100;}
?>
<tr bgcolor="#ffffff" onMouseOver="this.bgColor='#EBF4E3';" onMouseOut="this.bgColor='#FFFFFF';">
<td height="21" align="center"><?=$rs["id"]?></td>
<td align="left"><a href="List_Customer.php?userid_sale=<?=$rs["id"]?>"><?=$rs["u_xingming"]?></a></td>
<td align="center"><?=$nums?></td>
<td align="center"><?=$nums2?></td>
<td align="center"><div style="height:3px;width:80px;border: 1px solid #49AA00;text-align: left;vertical-align: middle; font-size:6px;">
<div style="height:3px;width:<?=$customer2?>%;background-color: #49AA00;font-size:6px;"></div>
</div><?=$customer2?>%</td>
<td align="center"><?=$nums1?></td>
<td align="center"><?=$nums0?></td>
<td align="center">
<a href="User_Update.php?id=<?=$rs["id"]?>&page=<?=$page?>">修改</a></td>
</tr>
<? }?>
<tr>
<td width="100%" height="30" colspan="8" bgcolor="#FFFFFF"> 页次:<? echo $page." / ".$pagecount?> 每页<font color="#FF0000"><?=$pagesize?></font> 条记录 总计<font color="#FF0000"><?=$total?></font> 条记录 <? for($k=1;$k<=$pagecount;$k++){
echo " <a href=?page=".$k."><b>".$k."</a></b>";}?></td>
</tr>
</table>