Re: passing form variables with the same name
| From: | 1LT John W. Holmes | Date: | Thu, 05 Dec 2002 12:55:43 +0000 |
| Subject: | Re: passing form variables with the same name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127134@lists.php.net to get a copy of this message | ||
> I'd love to use an array, but I don't think you can pass an array value
from
> a form and have it work on the update script - e.g. input
> name="Resource[0]"...
Ah, but you can... You can use exactly what you just wrote and have
$_POST['Resource'][0] in your processing script. Loop through that array and
you're good to go. Or, you can name them as name="Resource[]" and let PHP
handle creating the keys (they'll start at zero, anyhow).
Enjoy...
---John Holmes...