RE: [PHP] Session Array...

From: Date: Tue, 10 Jun 2003 23:57:30 +0000
Subject: RE: [PHP] Session Array...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150986@lists.php.net to get a copy of this message
> I am getting something like this: > > <input type=checkbox name='id[loco package]' value=1> > > I will be getting upto 5 of the above values, Thanks to John Holmes (from > this list) I know how to enter it into the database but how do i create a > session with the above? > > The reason why i want to do this is, > 1)user picks upto 5 packages to save to his account (done) > 2)if the user is already logged in then the insert query is run and all > goes > well (done) > 3) if the user has not logged in then it should be saved as a session and > he > should be presented with the login screen, after he logs in the insert > query > should be run from the session data.....without the user re-picking the > packages(not done) > > I was able to do the above (point 3) when i was working with a simple > array > (eg: id[]=1) but am unable to do so when working with the newer one > (id[something]=1).... Have you tried: $_SESSION['id'] = $id; Since you have register_globals on, I guess you'd use: Session_register("id"); maybe... :) ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#150986) next »