2014-05-02 34 views
0

我有一个应用程序在数据库中搜索活动作业,并将它们返回到结果列表中。该部分工作正常,但分页不起作用。当我点击链接转到下一个10个工作时,它只停留在同一页面上。为什么我的分页结果不起作用?

这里是代码的样子。

$currPage = (($s/$limit) + 1); 

// Links to access additional results 

if ($s>=1) { 
$prevs=($s-$limit); 
$upd_msg_prev = '<a href="'.$here.'?state='.$state.$cid_searched.'&amp;s='.$prevs.'">&lt;&lt;&nbsp;Prev 10</a> | '; 
if ($s>$numrows-10) { 
    $upd_msg_next = 'Next 10&nbsp;&gt;&gt;'; 
} 
} else { 
if ($numrows>10) { 
    $upd_msg_prev = '&lt;&lt;&nbsp;Prev 10 | '; 
} 
} 

$here = isset($_POST['here']); 


// calculate number of pages needing links 

$pages=intval($numrows/$limit); 

// Check how many $pages are needed by getting total plus one if there's a remainder 

if ($numrows%$limit) { 
$pages++; 
} 

// check to see if last page 

if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { 
$news=($s+$limit); 
$upd_msg_next = '<a href="'.$here.'?state='.$state.$cid_searched.'&amp;s='.$news.'">Next 10&nbsp;&gt;&gt;</a>';` 
} 
+0

最后两行代码中存在一个错误。 – HeroFTime

回答

0

我认为这个问题是$这里= isset ...

这个功能将在你的代码返回true或false,因此不会在$ upd_msg使用它意义...进一步下跌。

+0

将解决这个问题并再次尝试。 – user3594109

+0

我收到此通知时,我把它说出来。注意:未定义的变量:这里在/var/www/html/jobs.aacrao.org/search/results.php 254行 – user3594109

+0

我应该包括我的解决方案:$ here = 0; if(isset($ _ POST [“here”]))$ here = $ _ POST [“here here”]; – Tom201069

相关问题