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:
> >
> >
> >Modern
> >Mississippi
> >Civil Rights
> >MilitaryHistory
> >
> >
> >and mailform2.php containing:
> >
> >echo "you selected: ";
> >/* line 81 */ foreach
At 12:01 PM -0500 10/22/07, Adam Williams wrote:
I have an html page with checkboxes:
Modern
Mississippi
Civil Rights
MilitaryHistory
and mailform2.php containing:
echo "you selected: ";
/* line 81 */ foreach ($_POST[option] as $a)
{
echo "$a";
}
but I'm getting the
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 p
; CC: php-general@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:>>>>>>&
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
./array.php
Array
(
[0] => 1
[1] => 2
[2] => 3
)
Array
(
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.
On 10/22/07, Adam Williams <[EMAIL PROTECTED]> wrote:
>
> I have an html page with checkboxes:
>
>
> Modern
> Mississippi
Change to: ...
Someone mentioned this earlier, but I thought I'd reiterate. I'm not sure
how the browser will deal with *arrays* that aren't quoted. It's very good
practice
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 */ foreach ($_POST[option] as $a)
{
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 don'
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
[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
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 */ foreach ($_POST[option] as $a)
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 */ foreach ($_POST[opt
On 10/22/07, Adam Williams <[EMAIL PROTECTED]> wrote:
> I have an html page with checkboxes:
>
>
> Modern
> Mississippi
> Civil Rights
> MilitaryHistory
>
>
> and mailform2.php containing:
>
> echo "you selected: ";
> /* line 81 */ foreach ($_POST[option] as $a)
> {
> echo "$a";
>
Adam Williams wrote:
I have an html page with checkboxes:
Modern
Mississippi
Civil Rights
MilitaryHistory
and mailform2.php containing:
echo "you selected: ";
/* line 81 */ foreach ($_POST[option] as $a)
{
echo "$a";
}
but I'm getting the error:
you selected:
*Warn
On Oct 22, 2007, at 1:01 PM, Adam Williams wrote:
I have an html page with checkboxes:
Modern Mississippi
Civil
Rights
MilitaryHistory
and mailform2.php containing:
echo "you selected: ";
/* line 81 */ foreach ($_POST[option] as $a)
{
echo "$a";
}
but I'm getting t
16 matches
Mail list logo