Ceramic Weasel Posted April 28, 2006 Share Posted April 28, 2006 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 = " ";}[/code]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. Quote Link to comment https://forums.phpfreaks.com/topic/8599-previous-next-with-forms/ Share on other sites More sharing options...
.josh Posted April 28, 2006 Share Posted April 28, 2006 can i see the page in action what you have so far? got a linkie? Quote Link to comment https://forums.phpfreaks.com/topic/8599-previous-next-with-forms/#findComment-31538 Share on other sites More sharing options...
Ceramic Weasel Posted April 28, 2006 Author Share Posted April 28, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/8599-previous-next-with-forms/#findComment-31590 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.