Re: [PHP] PHP - Web/list Question...



On 9 Nov 2008, at 18:05, Micah Gersten wrote:
Stut wrote:
On 9 Nov 2008, at 07:16, Robert Cummings wrote:
On Sat, 2008-11-08 at 20:26 -0800, bruce wrote:
I've got a question/issue that I want to bounce off the list.

I have a list that extends over multiple pages. there might be 200
items,
and i don't want to have the items listed on the same page as it
would be
too long. i can break the list up, so i can have it be displayed over
multiple pages. however, i want the user to select different items
from the
list. given that the selected items might be over different pages,
what's
the best way of keeping a running track of the items that have been
selected??

I could have each page be a form, and do a post/get where i then
keep track
of the selected items from page to page, but that would appear to
get ugly.
i'm looking for pointers to other sites/code that might have already
implemented this kind of scenario.

thoughts/pointers would be appreciated...

Accumulate them in the session. When done, and before final action you
could let them view a summary of selected items and allow deletion of
any entries they don't want.

Unless they're likely to select hundreds of items I'd either go with a
persisted GET var or a cookie. No need to drag server-side storage
into this.

Server side storage is meant to be used. The session was one of the
greatest things that PHP has given to the web programming world. It
should not be feared. Also, why clutter up someone's machine with stuff
held in a cookie?

1. PHP certainly did not give sessions to the "web programming world".

2. Why clutter up your server architecture with sessions unless you're already using them reasonable purposes. What we're talking about here is a list of numbers, which I'm perhaps incorrectly assuming will be fairly short and extremely temporary?

IMHO sessions are overused in all web development, not just PHP. In most cases they're a wrecking ball when a tiny hammer will do. But it's your choice, wreck away!

-Stut

--
http://stut.net/
.



Relevant Pages

  • Re: [PHP] PHP - Web/list Question...
    ... I have a list that extends over multiple pages. ... of the selected items from page to page, ... Accumulate them in the session. ... saves on network bandwidth of sending and retrieving the data with each ...
    (php.general)
  • Re: [PHP] PHP - Web/list Question...
    ... I have a list that extends over multiple pages. ... of the selected items from page to page, ... Accumulate them in the session. ... Tamper with the GET data or tamper with ...
    (php.general)
  • Re: [PHP] PHP - Web/list Question...
    ... I have a list that extends over multiple pages. ... of the selected items from page to page, ... Accumulate them in the session. ... persisted GET var or a cookie. ...
    (php.general)
  • Re: [PHP] PHP - Web/list Question...
    ... I have a list that extends over multiple pages. ... of the selected items from page to page, ... Accumulate them in the session. ... but the same possibility of tampering existed with the POST data. ...
    (php.general)
  • Re: [PHP] PHP - Web/list Question...
    ... I have a list that extends over multiple pages. ... Accumulate them in the session. ... Therefore the chance of tampering is the same. ... Not true because if the data are stored in the cookie every time that the cookie is accessed the data are passing from the client to the server. ...
    (php.general)