Hi,

> I am not sure how I should me sending the checkbox name and variables
> and then how to actually insert the email addresses using the mail
> command.  Is there a better way than using a checkbox?

If you have a HTML form with a list of email addresses to send to you might
want the code to look something like:

 <input type='checkbox' name='sendTo[]' value='[EMAIL PROTECTED]' /> User
1<br />
 <input type='checkbox' name='sendTo[]' value='[EMAIL PROTECTED]' /> User
2<br />
 <input type='checkbox' name='sendTo[]' value='[EMAIL PROTECTED]' /> User
3<br />

Now in the resulting PHP code (assuming that you're using >= PHP v4.1.x and
using METHOD="get" in the form) you should find $_GET['sendTo'] is an array
of email addresses they ticked. Just add them as mail headers (you can find
simple instructions on the http://www.php.net/mail page in the user
comments).

If METHOD="post" then use $_POST, and if an old version of PHP is being
used then use $HTTP_POST_VARS / $HTTP_GET_VARS.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to