Home > php教程 > php手册 > body text

利用load后的数据库分页跳转的问题 php

WBOY
Release: 2016-06-06 19:45:45
Original
1516 people have browsed it

我用jquery的load属性插入一个数据库分页网页,然后一点击 任何一个跳转页面的链接时,就还回原来div中的内容!!! 如果要在load中传递参数,该怎么加参数??? 这是分页代码: ?php // Page分页函数 $page = $_GET["page"]; function Page($rows,$page_si

我用jquery的load属性插入一个数据库分页网页,然后一点击

任何一个跳转页面的链接时,就还回原来div中的内容!!!

如果要在load中传递参数,该怎么加参数???

这是分页代码:

// Page分页函数
$page = $_GET["page"];

function Page($rows,$page_size){
    global $page,$select_from,$select_limit,$pagenav;
 
    $page_count = ceil($rows/$page_size);

    if($page

    if($page >= $page_count) $page = $page_count;

    $select_limit = $page_size;

    $select_from = ($page - 1) * $page_size.',';

    $pre_page = ($page == 1)? 1 : $page - 1;

    $next_page= ($page == $page_count)? $page_count : $page + 1 ;

    $pagenav .= "第 $page/$page_count 页 共 $rows 条记录 ";
    $pagenav .= "首页 ";
    $pagenav .= "前一页 ";
    $pagenav .= "后一页 ";
    $pagenav .= "末页";
    $pagenav.=" 跳到

// 用Page函数计算出 $select_from 从哪条记录开始检索、$pagenav 输出分页导航
$rows = mysql_num_rows(mysql_query("select * from `cms_article` WHERE catPath='0,1,15' order by id desc "));
Page($rows,10);
$sql = "SELECT * FROM `cms_article` WHERE catPath='0,1,15' order by id desc  LIMIT $select_from $select_limit";
$rst = mysql_query($sql);
while ($row = mysql_fetch_array($rst)){
echo "

";
   echo "";
   echo "
$row[title] [$row[postTime]]
";
   }
  
  
echo $pagenav;
?>

使用的load语句为:

$("#wzb_wzb_zb").click(function() {                
  $("#wzb_right").load("wzb/zb.php");       
 });

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template