Hi, I have a the following form: <form action="mailing-list.php?action=send_select" method="post"> {foreach from=$results item=result name=results} <input name="id[]" type="hidden" id="id[]" value="{$result.id}"/> <li><input name="send_mail{$result.id}" type="checkbox" id="send_mail{$result.id}" /></li> <li>{$result.name|truncate:17:".."}</li> <li>{$result.email_address|truncate:17:".."}</li> <li>{$result.sdate|changedate}</li> <li><a href="mailing-list.php?action=delete&id={$result.id}" onclick="javascript:return confirm('Are you sure you want to delete?')">Delete</a></li> {/foreach} </form> PHP: What i want to do is enable me to select from this which users i want to send to by selecting the checkbox and then run a mail function on them when submitted. How would i go about only doing this to the ones selected? Cheers, Adam
is that code some kind of template system? looks interesting. well, assuming each form element is output from the 'foreach', then there are going to be multiple checkboxes: <li><input name="send_mail{$result.id}" type="checkbox" id="send_mail{$result.id}" /></li> PHP: (this is inside the foreach loop, and each one will have its own id) so you'll be able to select whichever ones you like, and then on submission of the form, you can just catch the id values. am i missing something?