<?php
// Website Contact Form Generator 
// http://www.tele-pro.co.uk/scripts/contact_form/ 
// This script is free to use as long as you  
// retain the credit link  

// get posted data into local variables
$EmailFrom = "jmcdonnell@cleanestchoice.com";
$EmailTo = "jmcdonnell@cleanestchoice.com";
$Subject = "Website Quote Form";
$Name = Trim(stripslashes($_POST['Name'])); 
$Email = Trim(stripslashes($_POST['Email']));
$Phone = Trim(stripslashes($_POST['Phone']));
$Address = Trim(stripslashes($_POST['Address']));
$Bedrooms = Trim(stripslashes($_POST['Bedrooms']));
$Bathrooms = Trim(stripslashes($_POST['Bathrooms']));
$Eat_in = Trim(stripslashes($_POST['Eat_in']));
$Dining_room = Trim(stripslashes($_POST['Dining_room']));
$Frog = Trim(stripslashes($_POST['Frog']));
$Den = Trim(stripslashes($_POST['Den']));
$Family_room = Trim(stripslashes($_POST['Family_room']));
$Laundry_room = Trim(stripslashes($_POST['Laundry_room']));
$Office = Trim(stripslashes($_POST['Office']));
$Playroom = Trim(stripslashes($_POST['Playroom']));
$Sun_room = Trim(stripslashes($_POST['Sun_room']));
$Media_room = Trim(stripslashes($_POST['Media_room']));
$Additional = Trim(stripslashes($_POST['Additional']));
$Additional2 = Trim(stripslashes($_POST['Additional2']));
$Family_members = Trim(stripslashes($_POST['Family_members']));
$Pets = Trim(stripslashes($_POST['Pets']));
$Footage = Trim(stripslashes($_POST['Footage']));
$Three_months = Trim(stripslashes($_POST['Three_months']));
$Service = Trim(stripslashes($_POST['Service']));
$Comments = Trim(stripslashes($_POST['Comments']));

// validation
$validationOK=true;

if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Bedrooms: ";
$Body .= $Bedrooms;
$Body .= "\n";
$Body .= "Bathrooms: ";
$Body .= $Bathrooms;
$Body .= "\n";
$Body .= "Eat_in: ";
$Body .= $Eat_in;
$Body .= "\n";
$Body .= "Dining_room: ";
$Body .= $Dining_room;
$Body .= "\n";
$Body .= "Frog: ";
$Body .= $Frog;
$Body .= "\n";
$Body .= "Den: ";
$Body .= $Den;
$Body .= "\n";
$Body .= "Family_room: ";
$Body .= $Family_room;
$Body .= "\n";
$Body .= "Laundry_room: ";
$Body .= $Laundry_room;
$Body .= "\n";
$Body .= "Office: ";
$Body .= $Office;
$Body .= "\n";
$Body .= "Playroom: ";
$Body .= $Playroom;
$Body .= "\n";
$Body .= "Sun_room: ";
$Body .= $Sun_room;
$Body .= "\n";
$Body .= "Media_room: ";
$Body .= $Media_room;
$Body .= "\n";
$Body .= "Additional: ";
$Body .= $Additional;
$Body .= "\n";
$Body .= "Additional2: ";
$Body .= $Additional2;
$Body .= "\n";
$Body .= "Family_members: ";
$Body .= $Family_members;
$Body .= "\n";
$Body .= "Pets: ";
$Body .= $Pets;
$Body .= "\n";
$Body .= "Footage: ";
$Body .= $Footage;
$Body .= "\n";
$Body .= "Three_months: ";
$Body .= $Three_months;
$Body .= "\n";
$Body .= "Service: ";
$Body .= $Service;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=quote.html\">";
}

?>