Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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: 20
Trades: 0
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:

Please login or register to view this content. Registration is FREE
ffsja is offline
Reply With Quote
View Public Profile Visit ffsja's homepage!
 
 
Register now for full access!
Old 06-25-2008, 01:07 PM Re: Is pagination possible using $_POST variables instead of $_GET?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
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.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.

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

Posts: 94
Trades: 0
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
Please login or register to view this content. Registration is FREE
! See a live
Please login or register to view this content. Registration is FREE
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
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
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

Please login or register to view this content. Registration is FREE
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?
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.17847 seconds with 12 queries