RE: PHP - Web/list Question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hmmmm....

if one uses sessions, or a db store, the underlying logic to get the input
vars from the form on the individual pages (for the list) will essentially
be the same.

i'll have to have a form element, with the input items. i'll need to process
the checkboxes for each item, and when the user selects the
"continue/submit" btn, i'll perform the get/post action which then
accumulates the items from the previous page...

for each page, i'll have to process logic for the items listed in the form,
to see if the user has changed his/her mind... (ie, when the user goes back
to a previous page.)

when the user submits the "continue" btn, it'll present a list of the
selected items, allowing the user to revise the list, by going back to the
original lists (via the "back" btn) items can be deleted, via a delete
checkbox for each item in the list...

checking a "submit" btn will then write the final data to the db storage...


page 1,2,...:

                                          previous  - next
  state     city    hospital   checkbox

                                          continue

the "continue" page

 -provides the list of the user selected items

  state     city    hospital   checkbox

                                          revise - finish

on the "continue" page, the the user can "uncheck" the checkbox, to remove
an item, or the user can "add" additional items, by selecting the "revise"
btn, which goes back to the initial pages/list..



thoughts/comments....



-----Original Message-----
From: Robert Cummings [mailto:robert@xxxxxxxxxxxxx]
Sent: Sunday, November 09, 2008 10:49 AM
To: Micah Gersten
Cc: Stut; bruce; php-general@xxxxxxxxxxxxx
Subject: Re:  PHP - Web/list Question...


On Sun, 2008-11-09 at 12:39 -0600, Micah Gersten wrote:
> Robert Cummings wrote:
> > On Sun, 2008-11-09 at 12:26 -0600, Micah Gersten wrote:
> >
> >> Stut wrote:
> >>
> >>> On 9 Nov 2008, at 18:14, Robert Cummings wrote:
> >>>
> >>>> On Sun, 2008-11-09 at 18:00 +0000, 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.
> >>>>>
> >>>> Well he did say he had multiple pages. Maybe he's only displaying 5
per
> >>>> page though. Still, sessions are easier to manage than GET vars since
> >>>> you don't need to append them to every form action URL to accumulate
> >>>> them. Session is managed transparently by PHP in most cases an
amounts
> >>>> to the approximate overhead of an include.
> >>>>
> >>> Seriously? You'd rather use sessions than explode, modify and implode
> >>> an array of numbers on each request? You really see that as a valuable
> >>> developer time-saver?
> >>>
> >>> The mind boggles, but as I've said before and probably will again it's
> >>> always a personal choice, I'm just suggesting alternatives.
> >>>
> >>> -Stut
> >>>
> >>>
> >> Also, by storing the information server side, there is less of a chance
> >> of the user tampering with the data.  Storing stuff in the session also
> >> saves on network bandwidth of sending and retrieving the data with each
> >> request.
> >>
> >
> > Nah, the problem is the same. Tamper with the GET data or tamper with
> > the POST date before it goes into the session. Need to check the
> > incoming data regardless.
> >
> > Cheers,
> > Rob.
> >
>
> Yes, but once it's in the session, it should be ok.

True, but the same possibility of tampering existed with the POST data.
Therefore the chance of tampering is the same.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux