Re: odd cookie behaviour

From: Date: Sun, 08 Apr 2001 06:00:59 +0000
Subject: Re: odd cookie behaviour
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-47634@lists.php.net to get a copy of this message
same results. certain items don't immediately show up in the cart until i add numerous other items. it's funny, because some items show up all the time, regardless of what order, etc. they're placed in the cart. very weird. thanks for your help though! "shaun" <php@sbutler.org> wrote in message news:01040720420304.01567@box... > I think you might wanna check if $cookie is set, not $cookie[0], if that > doesn't work just check if $cookie[0] = 0 > > -Shaun > > On Saturday 07 April 2001 21:10, matt thompson wrote: > > hey, > > > > i'm designing a small shopping cart w/ cookies where the cookie is used as > > an array (the array id being the product id) and the array value being the > > number of items selected. anyways, for the most part everything works > > fine, but with certain items if they're added to the cart, they get added, > > but unfortunately do not display in the cart until a few other items are > > added (the quantity of that product continues to increase regardless of > > whether or not it's shown in the cart). i have absolutely no idea why this > > is happening, and feel like i've tried most things that have come to mind. > > my cookie is being set like: > > > > if (!isset($cookie[0])) setcookie("cookie[0]", "0"); > > > > i do not have a product w/ id of zero (0), so i use that as the default id > > / value to set the cookie with. any suggestions _at_all_ would be > > appreciated. :) > > > > thanks, > > matt > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47634) next »