Re: a little help?

From: Date: Tue, 22 Aug 2000 21:00:44 +0000
Subject: Re: a little help?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13022@lists.php.net to get a copy of this message
On Tue, 22 Aug 2000, Scott Corneil wrote: > Hi, if some one could give me a pointer on my problem, it'd be much > appreciated. > > I have a form of the type > <select name="1"><option > value="2">blah</option><option > value="34">blah</option></select> > <select name="7"><option > value="26">blah</option><option > value="8">blah</option></select> > <select name="18"><option > value="31">blah</option><option > value="3">blah</option></select> Try this: <select name="selects[1]">...</select> <select name="selects[7]">...</select> <select name="selects[18]">...</select> Then in your PHP script you could access those form elements as $HTTP_POST_VARS[selects][$x] or as $selects[$x] (if you register_globals on), where $x is the number of the select tag you want. Dean. > > In my PHP code retreiving the results of this code, I can't receive the > values of > $1 > $7 > $18 > since they are numbers. > > I realize that if I rename them blah1, blah7, blah18 I can refer to them no > problem. > > However, I am generating 1, 7, 18 through another variable. > For example I have $var which counts up 1 through 18 > and I want to be able to go > echo "$$var"; and have it print the returned option value as I increment > $var though a loop. > > Is there any way to do this, or can you suggest a better way to attack this > problem? > > Thanks very much for your time. > > Scott > > > > >

« previous php.general (#13022) next »