PHP Checkbox Array HELP???? PLEASE??

I need help with a contact form that is emailed to me from my website. I cannot seem to get the checkbox fields sent to me. I know it needs to be done in a array but how would I code this below is my form and php…

div class=“row chk”>
Security System


Spa/Jacuzzi
			<div class="row chk">
					<span class="inputs"><span class="pad"><label><input name="amenityChecks[]" type="checkbox" value="Sprinkler System" /> <span class="labelWrap">Sprinkler System</span></label></span></span>
			</div>

[php]$virtualTour = $_POST[‘virtualTour’];
$priceflexTypeCode = $_POST[‘priceflexTypeCode’];
$headline= $_POST[‘headline’];
$description= $_POST[‘description’];
$amenityChecks=$_REQUEST[‘amenityChecks’];

$body = "




schoolDistrict: $schoolDistrict

virtualTour: $virtualTour

priceflexTypeCode: $priceflexTypeCode

amenity Checks: $amenityChecks

headline: $headline

description: $description
";

$headers = “From: $email\r\nMIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1”;
$success = mail($webMaster, $emailSubject, $body, $headers);

header(“Location: listingsubmitted.html”);

?>

[/php]

on my php file above I just noted a few fields that pertained to the form that is not my whole PHP file

Try this code:
[php]if(is_array($_POST[‘amenityChecks’])) $amenityChecks = implode(’, ',$_POST[‘amenityChecks’]);[/php]

THANK YOU!!! Worked perfectly!!! :smiley: :smiley: :smiley:

Sponsor our Newsletter | Privacy Policy | Terms of Service