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.
Link to comment
Share on other sites

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).
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.