Jump to content


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

Ceramic Weasel

previous / next with forms

Recommended Posts

I found a nice script which allows me to pull results from a database and display them over multiple pages using a combination of 'LIMIT' in the MySQL query and tracking page numbers with PHP. And it worked great until i decided i wanted to add a checkbox form item for each displayed result, and track those as well.

The problem is, i don't know how to pass form data to the variable array without using a standard form submit, and i can't use those as the "previous" and "next" links because each one needs to have it's own 'page' value. Currently, they're constructed like this:

[code]if ($pageNum > 1) {
  $page = $pageNum - 1;
  $prev = " <a href=\"$self?keywords=$keywords&category=$category&page=$page\">[Prev]</a> - ";
  $first = " <a href=\"$self?keywords=$keywords&category=$category&page=1\">[First Page]</a> ";
} else {
  $prev  = " ";
  $first = " ";
if ($pageNum < $maxPage) {
  $page = $pageNum + 1;
  $next = " - <a href=\"$self?keywords=$keywords&category=$category&page=$page\">[Next]</a> ";
  $last = " <a href=\"$self?keywords=$keywords&category=$category&page=$maxPage\">[Last Page]</a> ";
} else {
  $next = " ";
  $last = " ";

What i need is something that will allow me to move from page to page, carrying all those variables from the original search form, in addition to the new checkbox form data submitted on each page the user views.

Share this post

Link to post
Share on other sites
I don't have it hosted anywhere yet. It's a bit like what Hotdockets does on their search results page, though I can't seem to get their Javascript solution to work. I'm not even sure it's possible to do with PHP.

Share this post

Link to post
Share on other sites


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.