Paginating Results and static bookmarkable / savable pages

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
duncanwilkie
Forum Newbie
Posts: 17
Joined: Wed Feb 28, 2007 3:26 pm
Location: Bristol, UK

Paginating Results and static bookmarkable / savable pages

Post by duncanwilkie »

1. I want to have a simple results pagination - sort of DONE (I have simple pagination).
2. Whats the best way to make these results bookmarkable or savable items - even if the page data can change its state to one that would NOT be returned by the results?

- Overview: Property Website
Results: Available Properties (Rental)
When NOT available then page has basic details but says that this property has gone.

Should I ...
a. create all the pages as new property are added; really don't want to have to do this; cos its not something I personally want to update; and creating a template, and having to add support.

b. Is this the alternative; should I use php to create a page based on a template generated by a submission of a form based on php that can create pages? - must also be able to delete pages. - The trouble with this seems to be that it could suddenly burden the site with lots of pages.

c. Is this possible? Have the bookmark recognise the individual result by the primary key for this results?

d. Just use cookies to recognise the user, and then allow them to save any properties they are interested in?

Any links to useful pages would be most appreciated!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The search terms (and any other specifics to regenerate the same query) would need to be in the URL, that's really it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I had to do the same exact thing. I have a search from that I built which results in tabular data output that allows for paging and sorting. The thing is, it has to maintain the sort request, the page number and the form search values. The only way to do that is through the query string.
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

With regards to your other questions, you don't want to ever be actually writing pages to the server with PHP. Instead you have one page where the content changes based on data from a database.

So, if they are choosing a property with primary key of say 50, you retrieve that record from the database and display info about it. If the property is not available then you put an if statement in there to indicate that its not available.

If the property not longer exists, (say if the user had the page bookmarked), then you do a test for that and display and friendly error.
Post Reply