Greetings, The following code is from "Learning PHP5 [O'Reilly] on page 90. Example - 6.5:
I get a: Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\or_6.4.php on line 15 after submitting the form. I'm not sure why since the example uses the call to foreach() in which the array $lunch is passes through the call to retireve the values of the array Thank you for your help. TR ............ <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>"; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php