Jump to content

Prev/Next button logic on a form when limiting results to 30...


thepip3r

Recommended Posts

i have a form to search a db for certain information that writes to the $_POST superglobal and by default, the search results are limited to a $_GET['offset'] and $_GET['limit'] (which are set to 0,30 if they have not been otherwise set).  is there an easy way to repass the search parameters in $_POST back to the web browser when the user clicks Next or Prev? Right now when they click Next and Prev, the $_GET vars are passed correctly but nothing appears on the screen because $_POST['search'] is no longer set.  all help would be greatly appreciated.
You would need to carry the search term in the query string (the string after the ? in the url) across all the pages that need it or store the value in a session variable if you do not want the query term displayed in the url. Putting term into the $_POST is not possible unless you insert the term as a hidden field in a form and have the next and previous buttons form submissions. It just seems sloppy to have a form for the next and previous functionality and I recomend against it (if my recomendation means anything).

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.