2014-05-02 60 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

相關問題