Jump to content

php pagination

- - - - -

  • Please log in to reply
1 reply to this topic

#1
kwahedi

kwahedi

    Newbie

  • Members
  • PipPip
  • 10 posts
I've come across a problem - but any help would be appreciated.

When I query the database using the results posted from a form, the pagination works initially i.e. for the first 10 records but when I click on the 2 hyperlink for the second page of results it loses the $_POST variable and returns to the full data set with the undefined index error at the top.

What is the best way of keeping these variables available for the second (and further) pages? I've messed around with $_SESSION variables but can't quite get it to work.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
You should link to page.php?page=2 (and access it through $_GET,) when they click the second link, or even &items=12 if they selected they wished a certain amount of items per page, this is fairly standard and makes more sense if they want to bookmark the page for later.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users