Re: POST Arrays with register globals..
| From: | Analysis & Solutions | Date: | Wed, 12 Jun 2002 20:16:47 +0000 |
| Subject: | Re: POST Arrays with register globals.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101806@lists.php.net to get a copy of this message | ||
Hi Adam:
On Wed, Jun 12, 2002 at 01:15:03PM -0700, Adam Plocher wrote:
> <input type="checkbox" name="groups[]" value="3"
> checked> blah3<br>
>
> $groups[] = $_POST['groups[]'];
This is just wrong.
> $groups[] = $_POST['groups'];
This assigns the global groups array to one element in a local groups
array. So, if you then do the following, you'd see something:
echo $groups[0][0];
What I assume you're trying to do is create a whole new local groups array
containing everything in the global gropus array. Do this:
$groups = $_POST['groups'];
Of course, there is really no point in your doing that though. just use
$_POST['groups'][0] and you're good to go. Saves time and memory.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409