Forum Moderators: coopster

Message Too Old, No Replies

Previous product/ Next product

How do I create a 'next product', 'previous product' in PHP?

         

mousico

5:51 am on May 10, 2011 (gmt 0)

10+ Year Member



How do I create a 'next product', 'previous product' in PHP? I have a search results page that lists a number of products based on certain search criteria entered. Each product has a 'details' link that leads to a product details page for that product.I want to 'remember' the recordset when the user goes to the details page so that I can give the user a 'previous product' and 'next product' button so that they do not have to go back to the search results page each time they want to see another product in the search results. How do I go about this? I'm a bit confused/stuck and could really use some help/inspiration.

rocknbil

4:15 pm on May 10, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Generally this should go with a completed pagination system. It's a little too complex to discuss in a simple post, but you can get some ideas from this search:

pagination site:webmasterworld.com [google.com]

Agh, this site borks up the link. :-/ Enter that in Google.

mousico

9:34 am on May 11, 2011 (gmt 0)

10+ Year Member



Thanks for your reply. I'm quite comfortable with pagination and have successfully implemented it on the same site but this is slightly different as there is only 1 product each time. I think I've cracked it though.

omoutop

9:53 am on May 11, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




the user goes to the details page so that I can give the user a 'previous product' and 'next product' button so that they do not have to go back to the search results page


This is like normal pagination with the exception that in each page you show only 1 item. So, prev and next buttons/links will show what you want.