Hello
Thanks to you both for the help but as a PHP halfwit I am dumbfounded.
I have this:
Code:
<input class="formCheck" type="checkbox" value="Argyle" name="cities[]"> Argyle<br />
<input class="formCheck" type="checkbox" value="Aubrey" name="cities[]"> Aubrey<br />
<input class="formCheck" type="checkbox" value="Bartonville" name="cities[]"> Bartonville<br />
Though there are alot more, 118 I think.
How do I use the PHP snippet above to capture the selected ones by name and list them in the email. I have this:
PHP Code:
<?php
if (!$_POST['name'] || !$_POST['address'] || !$_POST['city'] || !$_POST['workphone']) {
header('Location: http://www.somesite.com/oops.html');
} else {
$message = <<<EOF
Submitted by:
Name: {$_POST['name']}
Company Name: {$_POST['company']}
Address: {$_POST['address']}
Address 2: {$_POST['address_2']}
City/State/Zip: {$_POST['city']}
Work Phone: {$_POST['workphone']}
FAX: {$_POST['fax']}
Email: {$_POST['email']}
Unit Size: {$_POST['unitSize']}
Occupants: {$_POST['occupants']}
Length: {$_POST['lengthoflease']}
Purchase: {$_POST['purchaseHome']}
My City Choices are:
($_POST['cities'])
Additional Comments:
{$_POST['form_comment']}
EOF;
mail('email address here', 'subject line here', $message, "From: {$_POST['email']}\n");
header('Location: http://www.somesite.com/thankyou.html');
}
?>
Don't laugh too hard as I said I am a programming halfwit and this is the best I can do. Everything works accept the checkboxes.
I get this in the email:
Submitted by:
Name: Me
Company Name: company
Address: 1234 fake st
Address 2: na
City/State/Zip: city, state, zip
Work Phone: 555-555-5555
FAX: na
Email: an email address
Unite Size: twoBedroom
Occupants: five
Length: sixMonths
Purchase: no
My City Choices are:
Array
Additional Comments:
testing
Thanks,
Bookmarks