Re: foreach()
| From: | Matt M. | Date: | Wed, 08 Sep 2004 14:31:43 +0000 |
| Subject: | Re: foreach() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196122@lists.php.net to get a copy of this message | ||
> Warning: Invalid argument supplied for foreach() in
> c:\apache\htdocs\or_6.4.php on line 15
do a print_r on $_POST to see what is in the array.
> <form method="post" action="eat.php">
> <select name="lunch[]" multiple>
> <option value="pork">BBQ Pork Bun</option>
> <option value="chicken">Chicken Bun</option>
> <option value="lotus">Lotus Seed Bun</option>
> <option value="pork">Bean Paste Bun</option>
> <option value="chicken">Bird-Nest Bun</option>
> </select>
> <br><br>
> <input type="submit" name="submit">
> </form>
> Selected buns:
> <br>
> <?
> foreach ($_POST['lunch'] as $choice)
> {
> print "You want a $choice bun.<br>";
> }
> ?>
looks like you are posting to another page, eat.php