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
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.