Reply
Is pagination possible using $_POST variables instead of $_GET?
Old 06-25-2008, 12:22 PM Is pagination possible using $_POST variables instead of $_GET?
Average Talker

Posts: 19
Is pagination possible using $_POST variables instead of $_GET?

I have a user form that spans several pages and when the finally click submit it sends them a TON of results usually using many, many, many fields (too many for a $_GET method to handle i think?).

But I want to use pagination so only 10-20 results show per page of results. Every example of pagination I have seen has me passing the pagination key variables by GET when the user clicks the next or previous link to scroll through the returned results.

But I can't pass the many, many database variables they are using to search by through GET so does anyone know of any examples of pagination using variables passed by POST?

thanks!
__________________
Website:
http://www.taigawebmasters.com/
ffsja is offline
Reply With Quote
View Public Profile Visit ffsja's homepage!
 
When You Register, These Ads Go Away!
Old 06-25-2008, 01:07 PM Re: Is pagination possible using $_POST variables instead of $_GET?
wayfarer07's Avatar
$frontend->developer

Posts: 1,046
Name: Abel Mohler
Location: Asheville, North Carolina USA
I think the only way to do this is to style form submit buttons so that they look like regular links, or your navigation, then include hidden fields inside each individual "form" with the required data you wish to pass.

The other thing you may want to consider learning is URL rewriting from the .htaccess file, to make the address bar appear clean.
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me

Last edited by wayfarer07 : 06-25-2008 at 01:09 PM.
wayfarer07 is online now
Reply With Quote
View Public Profile
 
Old 06-25-2008, 02:07 PM Re: Is pagination possible using $_POST variables instead of $_GET?
Skilled Talker

Posts: 94
ffsja

You can use Post if you would like. Just change the
PHP Code:
$var $_GET['page'
to
PHP Code:
$var $_POST['page']; 
When you find the script you want to use perhaps you can post examples if you get stuck and we can assist you from there.
__________________
Sell Templates? Try our Template Monster WebAPI absolutely free! See a live Template Shop Demo
ChadR is offline
Reply With Quote
View Public Profile
 
Old 06-25-2008, 06:44 PM Re: Is pagination possible using $_POST variables instead of $_GET?
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 984
Name: Jeremy Miller
Location: Reno, NV
I would recommend that you try something else.

Assign each search a unique code (see http://us3.php.net/manual/en/function.uniqid.php ). Then, assign a $_SESSION array which contains the search parameters. Then, add in the page to view along with the unique code via GET. This way, you only need to pass a small amount of data to be able to retain all the information you need. URLs would be of the format

search.php?search_id=XXXXX&page=Y

Oh, and the $_SESSION array would be of the format

$_SESSION[$searches_unique_id] = array(//Add parameters here);
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-26-2008, 12:43 PM Re: Is pagination possible using $_POST variables instead of $_GET?
Ultra Talker

Posts: 250
Yes, it is possible to use POST instead of GET. Grab your result from DB in one SESSION and then redirect back on your search page. Create variable from this SESSION and then create standard form with post button but action is on the same page. Then, independent of pressed button display results from your variable.
Working example without any GET is here:
http://www.sipar.hr/knjizara.php

Press in "Izbor prema nakladniku" any button below and see how is working. The other think (search, ordering, etc.) also work on same sistem, but site is on Croatian and I cannot explain it.

Shivaji
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Reply     « Reply to Is pagination possible using $_POST variables instead of $_GET?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12762 seconds with 12 queries