Re: newbie - how to receive/iterate posted arrays
| From: | David Robley | Date: | Mon, 01 Sep 2008 10:06:16 +0000 |
| Subject: | Re: newbie - how to receive/iterate posted arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279207@lists.php.net to get a copy of this message | ||
Govinda wrote:
> Hello early birds,
>
> I am going round and round the docs and list posts I saved on this
> topic... but I am still stumped.
> Kindly show me what I am missing. I want to simply send an array of
> vars via a post form to my receiving script.
>
> I've got simple inputs like this:
>
> <input name="tmbsToiterate[muir_beach_tmb]" type="hidden"
> value="muir_beach_tmb" />
> <input name="tmbsToiterate[ruby_mountain_tmb]" type="hidden"
> value="ruby_mountain_tmb" />
>
> they post to the script with this: (and this is the line giving the
> error)-
>
> foreach($_POST['$tmbsToiterate'] as $value) {
>
> The error is "Warning: Invalid argument supplied for foreach()"
>
> Seems so simple, but I can't get it... What am I doing wrong?
> -Govinda
foreach($_POST['tmbsToiterate'] as $value) {
Remove the $
Cheers
--
David Robley
"Our field is arthritis research," Tom and his room mate said jointly.
Today is Prickle-Prickle, the 25th day of Bureaucracy in the YOLD 3174.