netfrugal Posted October 9, 2006 Share Posted October 9, 2006 I have 2 pages. Form.php & Paginate.phpI enter the username into the form.php and it sends me over to paginate.php where it looks for records with the username I chose.I can see all the results on Paginate.php, but if I click to go to the next page (paginate.php?page=2) everything goes blank!Do the search parameters get lost after one page? Any help would be appreciated!thanks! Quote Link to comment https://forums.phpfreaks.com/topic/23451-paginating-issue/ Share on other sites More sharing options...
mendoz Posted October 9, 2006 Share Posted October 9, 2006 If you post your code it'll be easier to help Quote Link to comment https://forums.phpfreaks.com/topic/23451-paginating-issue/#findComment-106450 Share on other sites More sharing options...
HuggieBear Posted October 10, 2006 Share Posted October 10, 2006 [quote author=netfrugal link=topic=110978.msg449400#msg449400 date=1160417366]Do the search parameters get lost after one page? [/quote]Yes, unless you save them in a session variable, or pass them in the URL along with the page number (I think the second is probably preferable in your case).Say your form submits with a URL like this:[color=green]http://www.mydom.com/paginate.php?cat=shirts&sort=asc[/color]Then the links in your paginate page should look a little like this:[code=php:0]echo <<<HTML<a href="paginate.php?cat={$_GET['cat']}&sort={$_GET['sort']}&page={$i}">$i</a>HTML;[/code]This would take you to the following url:[color=green]http://www.mydom.com/paginate.php?cat=shirts&sort=asc&page=2[/color]I've used heredoc syntax to escape the HTML above, if you're unaware of this, look it up here: [url=http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]heredoc[/url]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23451-paginating-issue/#findComment-106688 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.