Re: [PHP] problem with foreach

2007-10-23 Thread tedd
At 12:01 PM -0500 10/22/07, Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil RightsCivil Rightsbr input type=checkbox

Re: [PHP] problem with foreach

2007-10-23 Thread Andrew Ballard
On 10/23/07, tedd [EMAIL PROTECTED] wrote: At 12:01 PM -0500 10/22/07, Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[]

Re: [PHP] problem with foreach

2007-10-22 Thread Jason Pruim
On Oct 22, 2007, at 1:01 PM, Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil RightsCivil Rightsbr input

Re: [PHP] problem with foreach

2007-10-22 Thread Stut
Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil RightsCivil Rightsbr input type=checkbox name=option[] value=Military

Re: [PHP] problem with foreach

2007-10-22 Thread Andrew Ballard
On 10/22/07, Adam Williams [EMAIL PROTECTED] wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil RightsCivil Rightsbr input

Re: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil RightsCivil

Re: [PHP] problem with foreach

2007-10-22 Thread Adam Williams
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[]

RE: [PHP] problem with foreach

2007-10-22 Thread Jay Blanchard
[snip] print_r($_POST['option']); it prints nothing. [/snip] Try resetting the array first, you may be at the end of the array; reset($_POST); print_r($_POST); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 12:20 -0500, Adam Williams wrote: Yeah, thats the problem I'm having for some reason. When I do: print_r($_POST['option']); it prints nothing. It's usually more informative to see everything that was posted so you might have more of an idea what may have went

Re: [PHP] problem with foreach

2007-10-22 Thread Ludovic André
Adam Williams a écrit : I have an html page with checkboxes: [...] but I'm getting the error: you selected: *Warning*: Invalid argument supplied for foreach() in */var/www/sites/mdah-test/museum/mmhsurvey/mailform2.php* on line *81* I googled some checkbox/foreach pages on google, but I

Re: [PHP] problem with foreach

2007-10-22 Thread Stut
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr input type=checkbox name=option[] value=Civil

Re: [PHP] problem with foreach

2007-10-22 Thread Philip Thompson
On 10/22/07, Adam Williams [EMAIL PROTECTED] wrote: I have an html page with checkboxes: form action=mailform2.php method=POST input type=checkbox name=option[] value=Modern MississippiModern Mississippibr Change to: input type=checkbox name=option[] value=... /...br/ Someone mentioned

Re: [PHP] problem with foreach

2007-10-22 Thread Nathan Hawks
Also, AFAIK, PHP has always thrown a warning or notice if you use foreach() on a non-associative array. That doesn't mean it won't work, but the strict standard is apparently: foreach ($assoc as $key = $val) not foreach ($indexed as $item) However, as we all know, the latter still works fine.

Re: [PHP] problem with foreach

2007-10-22 Thread Greg Donald
On 10/22/07, Nathan Hawks [EMAIL PROTECTED] wrote: Also, AFAIK, PHP has always thrown a warning or notice if you use foreach() on a non-associative array. PHP arrays are always associative: cat array.php #!/usr/bin/env php ?php error_reporting( E_ALL ); $a = array( 1, 2, 3 ); $b = array(

RE: [PHP] problem with foreach

2007-10-22 Thread Bastien Koert
@lists.php.net Subject: Re: [PHP] problem with foreach Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo you selected: ; /* line 81

RE: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 19:59 -0400, Bastien Koert wrote: I am sure that I am late to the party, but am sure that double or single quotes at least are needed around the attribute values to make this work Late to the party and completely off the mark taboot. Don't need quotes at all. It's bad