Steve,

Your suggestion would not work.

The building of the drop down list, and the insertion to the cart happen
during different http requests.  Your locally scoped variable "ua_product"
would be lost and would not be available for the filter on the next request.

If you changed it to a user scoped variable it would start to work properly,
but now you've got user variables for every user on the site looking at
products which could take up a lot of memory if there are a lot of
concurrent users.

Plus you have another problem... Consider the following scenario.

User looks at product 1
   product 1 pricing data is cached in array

User spawns new window, and looks at product 2
   product 2 pricing data is cached in array

User uses the first window to choose a size for product 1
   when the insert occurs, the price won't be available, because
   the pricing info for product 2 is now cached.. the filter will
   return empty data.

/John


----- Original Message -----
From: "Steve Smith" <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]>
Sent: Thursday, August 29, 2002 3:57 PM
Subject: RE: Witango-Talk: Two Inserts from a Drop Down


> The suggestion that I made does not allow the price to be inserted from
the
> browser. It is inserted by viewing the product the user has selected and
> looking up the price of that product (by means of searching an array
rather
> than the database). If I am guessing what Web Dude is attempting to do, he
> needs to write the product's price to the table at time of sale. Otherwise
> if he relies on a join to the product table, if he reviews orders at a
later
> date and the price has changed the order data is not accurate.
>
> Hope this helps,
>
> Steve Smith
>
> Skadt Information Solutions
> Office: (519) 624-4388
> GTA:    (416) 606-3885
> Fax:    (519) 624-3353
> Cell:   (416) 606-3885
> Email:  [EMAIL PROTECTED]
> Web:    http://www.skadt.com
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of John McGowan
> > Sent: August 29, 2002 4:39 PM
> > To: Multiple recipients of list witango-talk
> > Subject: Re: Witango-Talk: Two Inserts from a Drop Down
> >
> >
> > Dude,
> >
> > If you do it the way you want to do it, (which is totally
> > possible with the
> > other posters suggestions) you're opening yourself up to abuse by
> > malicious
> > users.
> >
> > I assume you're talking about inserting new rows into a shopping
> > cart table
> > or something like that.  If you rely on getting the price from
> > the browser,
> > then it would be very easy for someone to buy a T shirt for 5
> > bucks instead
> > of 13.
> >
> > You should make a habit of never relying on the browser to send you
> > something as important as a price.
> >
> > My 2 cents.
> >
> > /John
> >
> >
> > ----- Original Message -----
> > From: "Web Dude" <[EMAIL PROTECTED]>
> > To: "Multiple recipients of list witango-talk"
<[EMAIL PROTECTED]>
> > Sent: Thursday, August 29, 2002 12:37 PM
> > Subject: Witango-Talk: Two Inserts from a Drop Down
> >
> >
> > > I've seen this posted before, but can't seem to find it.
> > >
> > > I have a table that has size and price info. Example:
> > >
> > > ID Size Price
> > > 1 S 10.00
> > > 2 L 11.00
> > > 3 XL 12.00
> > > 4 XXL 13.00
> > >
> > > I do a db call to load a dropdown. I would like to display the size
> > > in the dropdown and  insert BOTH the size and the price from the
> > > dropdown.
> > >
> > > I realize I could do a search on the ID before the insert and then
> > > insert from the results, but is there a slicker way of doing this
> > > with just an insert?
> > >
> > > Thanks!
> > > --
> > >
________________________________________________________________________
> > > TO UNSUBSCRIBE: send a plain text/US ASCII email to
[EMAIL PROTECTED]
> > >                 with unsubscribe witango-talk in the message body
> >
> > ________________________________________________________________________
> > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
> >                 with unsubscribe witango-talk in the message body
> >
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>                 with unsubscribe witango-talk in the message body

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to