|
Posted by Rik on 01/31/07 22:35
JackM <notme@earthlink.net> wrote:
> Okay, I'm starting to get a little ticked off because I've worked for =
=
> hours on this and I can't seem to find the cause. I'm using PHP 5.1.6.=
=
> I'm trying to get the values of some form checkboxes along with anothe=
r =
> fixed variable and pass them along in an email. For demonstration =
> purposes, I have checked the Wed and Fri checkboxes and set the time f=
or =
> 9:00 am.
> When I print out print_r($_POST);, I get everything passed correctly =
as:
>
> Array
> (
> [NewClass] =3D> Array
> (
> [0] =3D> Wed
> [1] =3D> Fri
> )
>
> [NewClass-Time] =3D> 9:00 am
> )
>
> But when it gets emailed, the results listed on the email I get are as=
=
> follows:
>
> NewClass: Array
>
> NewClass-Time: 9:00 am
>
> I stripped the processing script down to the barest of essentials. All=
=
> that's on it right now is:
>
> foreach($_POST as $key =3D> =
> $value){if(!(!isset($value))){$set=3D1;}$message =3D $message . "$key:=
=
> $value\n\n";}
$value will always be set, even if it's an empty string (a lot of browse=
rs =
default to on though). So what the "if(!isset($value))" does?
foreach($_POST as $key =3D> value){
$message =3D $key . ': '.((is_array($value)? implode(',',$value): $val=
ue);
}
-- =
Rik Wasmus
[Back to original message]
|