Fill out this form for a No-Obligation Mailing List Quote
'Geographic Area',
2 => 'Age',
3 => 'Income',
4 => 'Gender',
5 => 'Marital Status',
6 => 'Households with Children',
7 => 'Age and Gender of Children',
8 => 'Households with Seniors',
9 => 'Housing Type',
10 => 'Homeowner / Renter',
11 => 'Home Value',
12 => 'Year Home Built',
13 => 'Length of Residence',
14 => 'Ethnicity',
15 => 'Religion',
16 => 'Hobbies & Interests',
17 => 'Pool Owners',
18 => 'Motorcycle Owners',
19 => 'Vehicle Make Owners',
20 => 'Basic Business including geography & SIC code',
21 => 'Business Plus: give any specifics you want, number of employees (more than 5, more than 100, etc), size of business (over 1million sales, 10 million in sales, etc), franchise type, minority owners business, women owned, etc. Titles (President, owner, marketing, etc.)'
);
// if Submit was NOT clicked, initialize the form variables, display the form and exit
if (!array_key_exists('submit', $_POST)) {
foreach(array('name', 'company', 'address1', 'address2', 'citystzip', 'youremail', 'yourfax', 'phone', 'recQty', 'zipCodes', 'miles', 'driveTime', 'typeOfAddress', 'addressFilter', 'use', 'fax', 'comment') as $field) { // no -- initialize the text fields
$_POST[$field] = '';
}
showForm(); // display the form
showBottom(); // paint the bottom HTML
exit;
}
// Submit was clicked validate the data
foreach($_POST as $key => $value) { // yes -- strip tags and leading/trailing spaces
$_POST[$key] = strip_tags(trim($value));
}
$error = '';
// this tests for a blank text-input field (make sure to initialize text fields above)
if ($_POST['name'] =='') {
$error .= '
Name is required
';
}
if ($_POST['phone'] =='') {
$error .= '
Phone is required
';
}
if ($_POST['company'] =='') {
$error .= '
Company is required
';
}
if ($_POST['address1'] =='') {
$error .= '
Address is required
';
}
// don't require second address field
if ($_POST['citystzip'] =='') {
$error .= '
City, State and Zip required
';
}
if ($_POST['youremail'] =='') {
$error .= '
Email is required
';
}
// don't require fax
// this tests radio and checkbox fields
if (!array_key_exists('ROB', $_POST)) {
$error .= '
Residential, Occupant or Business List is required
';
}
// php wants all variable to be initialized before they're referenced.
// This tests if the approxRecords radio (Y or N) is initialized by user clicking it before checking it's value.
// If it is checked, is it yes? If so, a quantity is required.
if ( (array_key_exists('approxRecs', $_POST)) && ($_POST['approxRecs'] == 'Yes') && ($_POST['approxRecsQty'] == '') ) {
$error .= '
Estimate for Approximate Quantity requested but Quantity was not entered.
';
}
if ($error != '') { // there are errors, re-display the form
showForm($error);
showBottom();
exit;
}
// form is OK, say thanks and mail the results
print 'Thank you for your request. We will contact you soon.';
showBottom();
$to = 'jmorris@morrisgraphics.com';
$headers = "From: jmorris@morrisgraphics.com\n";
$subject = 'Mail List Price request';
$message = "Name: $_POST[name];
Phone: $_POST[phone];
Company: $_POST[company];
Address1: $_POST[address1];
Address2: $_POST[address2];
City, State, Zip: $_POST[citystzip];
Email: $_POST[youremail];
Fax: $_POST[yourfax];
Residential, Occupant or Business: $_POST[ROB]
Approximate # Records needed: $_POST[recQty]
Zip Code(s): $_POST[zipCodes]
Miles From Location: $_POST[miles]
Minutes From Location: $_POST[driveTime]
Type of Residential Addressing: $_POST[typeOfAddress]
Residential Filter: $_POST[addressFilter]
Occupant List Ideas:\n";
foreach ($ideas as $key => $idea) {
$name = 'idea' . $key;
if (array_key_exists($name, $_POST) && $_POST[$name] == $key) {
print $message .= "-$idea\n";
}
}
$message .= "\nUsage: $_POST[use]
Include Fax #s: $_POST[fax]
Comments: $_POST[comment]";
mail($to, $subject, $message, $headers);
exit;
function showBottom() {
?>