RE: [PHP] Javascript and Dynamic Form elements with PHP
| From: | Joao Prado Maia | Date: | Wed, 09 Aug 2000 22:41:46 +0000 |
| Subject: | RE: [PHP] Javascript and Dynamic Form elements with PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11009@lists.php.net to get a copy of this message | ||
On Wed, 9 Aug 2000, Christensen, BruceX R wrote:
> I'm afraid you're out of luck on this one (without renaming your form
> elements). However, renaming the form elements isn't as bad as it sounds,
> as this code illustrates:
>
> $cgi = getenv("REQUEST_METHOD") == 'GET' ? $GLOBALS[HTTP_GET_VARS] :
> $GLOBALS[HTTP_POST_VARS];
>
> // loop through each cgi variable
> foreach ($cgi as $key => $value) {
> // if it is named friend_name_ followed by a number, put it into the
> array $friend_name
> if (eregi("^friend_name_([0-9]+)$", $key, $matches)) {
> $num = $matches[1];
> $friend_name[$num] = $value;
> }
> }
>
Yeah, I know it isn't that bad, but it isn't as pretty as using a true
array on PHP. Anyway, I just thought someone had a work-around for this
one, since this is the second time this specific problem comes up for me.
Thanks,
Joao
--
Joao Prado Maia
Web Developer
Kefta.com, Inc