gum1982 Posted February 23, 2010 Share Posted February 23, 2010 Hi Guys Ive got a form as follows, <form method="post" action="<?php bloginfo("template_url"); ?>/process-discounted.php"> <table width="320" border="1"> <tr> <td><input type="checkbox" class="small" value=".co.uk" name="dom[]" />.co.uk</td> <td><input type="checkbox" class="small" value=".com" name="dom[]" />.com</td> <td><input type="checkbox" class="small" value=".org" name="dom[]" />.org</td> <td><input type="checkbox" class="small" value=".org.uk" name="dom[]" />.org.uk</td> </tr> <tr> <td><input type="checkbox" class="small" value=".net" name="dom[]" />.net</td> <td><input type="checkbox" class="small" value=".tv" name="dom[]" />.tv</td> <td><input type="checkbox" class="small" value=".biz" name="dom[]" />.biz</td> <td><input type="checkbox" class="small" value=".mobi" name="dom[]" />.mobi</td> </tr> <tr> <td><input type="checkbox" class="small" value=".me" name="dom[]" />.me</td> <td><input type="checkbox" class="small" value=".me.uk" name="dom[]" />.me.uk</td> <td><input type="checkbox" class="small" value=".eu" name="dom[]" />.eu</td> <td><input type="checkbox" class="small" value=".info" name="dom[]" />.info</td> </tr> </table> <p> <input class="submit" type="submit" id="submit" name="submit" value="submit"/> </p> </fieldset> </form> This is my process.php $aDoor = $_POST['dom']; $N = count($aDoor); for($i=0; $i < $N; $i++) { $domains = ($aDoor[$i] . " "); } include "MIME.class"; $to = '[email protected]'; $str = "Domains ".date('M Y', time()); $html_data = '<html lang="en"> <head> <title>Template 2 :: Versatile Newsletter</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" bgcolor="#F0F0F0"> <table cellpadding="0" cellspacing="0" width="720" align="center"> <tr> <td width="250">Domains:</td> <td width="250">'.$domains.'</td> </tr> </table> <br /> <br><br></td></tr> </table> </td></tr></table><!-- end wrapper table--> </body> </html>'; $mime = new MIME_mail("Discounted Hosting", $to, $str); $mime->attach($html_data, "", HTML, BASE64); $mime->send_mail(); } ?> This echos out the boxes checked which is fine but i need to send all the values in a email. how can i send these value in the email currently i only always get one value i need them to be broken up. any help please Link to comment https://forums.phpfreaks.com/topic/193040-checkboxes-form/ Share on other sites More sharing options...
PravinS Posted February 23, 2010 Share Posted February 23, 2010 You can concatenate $domains with "," or use implode() function to concatenate, and email the concatenated string in mail. According to your coding you will get only last selected value in mail body. Link to comment https://forums.phpfreaks.com/topic/193040-checkboxes-form/#findComment-1016666 Share on other sites More sharing options...
jl5501 Posted February 23, 2010 Share Posted February 23, 2010 If you had $domainString = implode(",",$aDoor) that would give you a comma separated string of all the selected domains. Link to comment https://forums.phpfreaks.com/topic/193040-checkboxes-form/#findComment-1016667 Share on other sites More sharing options...
gum1982 Posted February 23, 2010 Author Share Posted February 23, 2010 Brilliant thanks guys worked a treat Link to comment https://forums.phpfreaks.com/topic/193040-checkboxes-form/#findComment-1016674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.