Posted by Michael Fesser on 12/04/07 22:00
..oO(ATDave)
>So basically I'm just creating a form that I want the results e-mailed
>to somebody. I have everything working except for the checkmark
>sections that can have multiple answers. I'm a newbie when it comes
>to PHP, so please be easy :)
>
>So to show an example:
>
><input type="checkbox" name="SelfDevelopmentInterest[]" class="other"
>value="Self Confidence" />
><label class="left">Self Confidence</label> <br />
><input type="checkbox" name="SelfDevelopmentInterest[]" class="other"
>value="Hair Make up" />
><label class="left">Hair/Make-up</label> <br />
><input type="checkbox" name="SelfDevelopmentInterest[]" class="other"
>value="Poise Posture" />
><label class="left">Poise/Posture</label> <br />
><input type="checkbox" name="SelfDevelopmentInterest[]" class="other"
>value="Interview Skills" />
><label class="left">Interview Skills</label> <br />
>
>This is the checkbox options a user has. So on my confirmation page I
>create the variable:
>
>$SelfDevelopmentInterest = $_POST['SelfDevelopmentInterest'];
>
>In the actual message, currently I print it out like this:
>
>Self-Development Interest: $SelfDevelopmentInterest
>
>When I get the e-mail, it only displays "Array". Say a user checks
>the first three options, how can I pass all three and print it out in
>the e-mail?
For a really simple array print use either print_r() or var_dump(). For
a more sophisticated result you would have to loop through the array and
print out the values yourself in the way you like.
Micha
[Back to original message]
|