Jump to content

Getting checkboxes ticked to email


JohneeMac

Recommended Posts

Hi i want the checkboxes selected to be sent to my mail account. The email part works fine but i just cant get these checkboxes to be included.



[code]<input type="checkbox" name="foo[]" class="no"  id="fishing" value="Fishing"  "/>

<input class="no" name="foo[]" type="checkbox" id="quadBiking" value="Quad Biking" />
    

<input class="no" name="foo[]" type="checkbox" id="gameShooting" value="Game Shooting/>[/code]




[code]$foo = $_POST['foo'];
if (count($foo) > 0) {
    
     for ($i=0;$i<count($foo);$i++) {

            $actos .= "$foo[$i]\n";

     }

}

[/code]



Any help greatly appreciated.
Link to comment
https://forums.phpfreaks.com/topic/5189-getting-checkboxes-ticked-to-email/
Share on other sites

Thanks for the reply Ken.

I put in the code as you said but its still not working

i have :

[code]mail($recipient, $subject, "\n Group Number: $group \n\n Activities: $actos \n\n Message:$msg ", $headers);[/code] for sending mail

and

[code] if (isset($_POST['foo'])) $actos = implode("\n",$_POST['foo'])."\n";[/code]

for getting the variables.

Thanks for your help

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.