Re: looping through values from a field? Need hellp.
| From: | Lars Torben Wilson | Date: | Sun, 06 Jul 2003 00:18:16 +0000 |
| Subject: | Re: looping through values from a field? Need hellp. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154097@lists.php.net to get a copy of this message | ||
On Sat, 2003-07-05 at 17:13, Micah Montoya wrote:
> Ok. I gave it a shot but have run into one other question that I wasn't
> able to find that was addressed by the article.
>
> My select statement looks like this:
>
> <select name="imgList[]" style="width:350;" size="6"
> multiple></select>
>
> When I create the php file, I am trying something like below but it isn't
> working and I am receiving an error. What am I not doing?
>
> $filename = $_POST["imgList"];
>
> for each ($filename as $value) {
> echo $value;
> }
>
> thanks
Impossible to say without know what the error says. :) Anyway, if that
code is cut-and-pasted, then 'foreach' should have no space in it. That
would cause a parse error. Otherwise, you could be getting a Notice
if you're actually passing something in via method="GET" but checking
the $_POST array instead.
--
Torben Wilson <torben@php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----