Jump to content

pagination with GET info in page links


final60

Recommended Posts


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.

Link to comment
https://forums.phpfreaks.com/topic/244124-pagination-with-get-info-in-page-links/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.