final60 Posted August 7, 2011 Share Posted August 7, 2011 Hi Im using basic pagination to split up forum threads. For some reason when a page link is clicked the GET info is not passed in the url and the page number is: $per_page = 5; $page_query = mysql_query("SELECT count(post_id) FROM urbex_forum_posts"); $pages = ceil(mysql_result($page_query, 0) / $per_page); $page = (isset($_GET )) ? (int)$_GET['page']: 1; $start = ($page - 1) * $per_page; if($pages >=1 && $page <=$pages) { for($x=1;$x<=$pages;$x++) { echo $_GET['cat_id'].' '.$_GET['cat_name']; $cat_id = $_GET['cat_id']; $cat_name = $_GET['cat_name']; echo ($x == $page) ? '<a href="?cat_id='.$cat_id.'&cat_name='.$cat_name.'&page='.$x.'">['.$x.']</a>' : '<a href="?page='.$x.'">'.$x.'</a>'; } } $query2 = mysql_query("query...."); ... thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/244124-pagination-with-get-info-in-page-links/ Share on other sites More sharing options...
final60 Posted August 7, 2011 Author Share Posted August 7, 2011 DOH found i. Always the little things I miss grrrr. I forgot to repeat the catid and catname in the ternary operator.. Quote Link to comment https://forums.phpfreaks.com/topic/244124-pagination-with-get-info-in-page-links/#findComment-1253712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.