Forum Moderators: coopster
Here's the code handling the checkboxes.
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="phonecalls">
Making/receiving phone calls</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="envelopes">
Stuffing envelopes</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="filing">
Filing</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="copies">
Making Copies</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="typing">
Typing</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="activities">
Assisting with group activities</label>
<br>
<label>
<input name="dayToDay[]" type="checkbox" id="dayToDay" value="other">
Other</label>
<input name="otherTF" type="text" id="otherTF" size="20" maxlength="50">
</span> <label></label>
Heres the other part.
<?php
@extract($_POST);
$firstName = stripslashes($firstName);
$lastName = stripslashes($lastName);
$address = stripslashes($address);
$city = stripslashes($city);
$state = stripslashes($state);
$zipCode = stripslashes($zipCode);
$phone = stripslashes($phone);
$email = stripslashes($email);
$faxNo = stripslashes($faxNo);
$dayToDay = stripslashes($dayToDay);
$otherTF = stripslashes($otherTF);
$specialEvent = stripslashes($specialEvent);
$days = stripslashes($days);
$am = stripslashes($am);
$pm = stripslashes($pm);
$spEvAM = stripslashes($spEvAM);
$spEvPM = stripslashes($spEvPM);
mail('#*$!@xxxx.com','Volunteer Form', "From: $lastName, $firstName <$email>
First Name: $firstName
Last Name: $lastName
Address: $address
City: $city
State: $state
Zip Code: $zipCode
Phone: $phone
Email: $email
Fax: $faxNo
Availability for Day to day operation: $dayToDay
Other: $otherTF
Availability for Special Events: $specialEvent
Days: $days
AM: $am
PM: $pm
Special Event AM: $spEvAM
Special Event PM: $spEvPM");
?>
It's something like:
foreach ($_POST('dayToDay') AS $Key => $dayToDay) {
blah blah blah here;
}
It's something like that...I'm sure someone will come along and correct me. I'm new, too.
inveni0 is correct (except that the variable reference should have square braces: $_POST['dayToDay'])
Another thing you can do is replace the line:
$dayToDay = stripslashes($dayToDay); $dayToDay = stripslashes([url=http://www.php.net/implode]implode[/url](", ", $dayToDay));