|
|
Dream Home Finder from Stacy Hall
if($action == "send") {
if ( !$form[name] || !$form[address] || !$form[phone] || !$form[city] || !$form[email] ) {
print "
Dream Home Finder Error
";
if(!$form[name]) {
print " You have not included
your name.
Your name is required to process this form. ";
}
if(!$form[address]) {
print " You have not included
your address.
Your address is required to process this form. ";
}
if(!$form[phone]) {
print " You have not included
your telephone number.
Your telephone number is required to process this form. ";
}
if(!$form[city]) {
print " You have not included
your city.
Your city is required to process this form. ";
}
if(!$form[email]) {
print " You have not included
your email address.
Your email address is required to process this form. ";
}
print " Please use your browser's BACK function or the link below
to return to the Dream Home Finder Form and resubmit.
Thank you!
";
print "Return to
Dream Home Finder ";
exit;
}
if(!$form[subject]) {
$form[subject] = "$no_subject"; }
if(!$form[name]) {
$form[name] = "$no_name"; }
$final_recipient = "$recipient@$domain";
$letter = "Greetings from $form[name]!\n\n";
$letter .= "My Address is:\n";
$letter .= "\t" . $form[address] . "\n";
$letter .= "\t" . $form[city] . "\n\n";
$letter .= "My phone number is: $form[phone]\n";
if ($form[email]) {
$letter .= "My email address is: $form[email]\n";
}
if ($form[fax]) {
$letter .= "My FAX number is: $form[fax]\n";
}
if ( $form[prop_single] || $form[prop_town] || $form[prop_condo] || $form[prop_duplex] || $form[prop_custom] || $form[prop_lot] || $form[prop_other] ) {
$letter .= "\nI am interested in the following property classifications:\n\t ";
if ($form[prop_single]) { $prop .= "SingleFamily "; }
if ($form[prop_town]) { $prop .= "Townhouse "; }
if ($form[prop_condo]) { $prop .= "Condominium "; }
if ($form[prop_duplex]) { $prop .= "Duplex "; }
if ($form[prop_custom]) { $prop .= "Custom "; }
if ($form[prop_lot]) { $prop .= "Lots&Land "; }
if ($form[prop_other]) { $prop .= "Other "; }
$letter .= $prop . "\n";
}
if ($form[arch_style]) $letter .= "\nI am interested in the following home style: " . $form[arch_style] . "\n";
if ( $form[basement] || $form[num_bedrooms] || $form[garage] || $form[baths] ) { $letter .= "\nThe home has:\n ";
if ($form[num_bedrooms]) { $letter .= "\t" . $form[num_bedrooms] . " bedroom(s)\n "; }
if ($form[garage]) { $letter .= "\t" . $form[garage] . "\n "; }
if ($form[baths]) { $letter .= "\t" . $form[baths] . " bathroom(s)\n"; }
if ($form[basement]) { $letter .= "\t" . $form[basement] . "\n"; }
$letter .= "\n";
}
if ( $form[age] ) { $letter .= "It is " . $form[age] . " years old.\n"; }
if ( $form[feature_family] || $form[feature_den] || $form[feature_laundry] || $form[feature_fireplace] ||
$form[feature_dining] || $form[feature_pool] || $form[feature_porch] || $form[feature_skylight] ||
$form[feature_bar] || $form[feature_vac] || $form[feature_suite] || $form[feature_fence] ) {
$letter .= "\nThe home has the following features: \n";
if ( $form[feature_family] ) { $letter .= "\t" . $form[feature_family] . "\n"; }
if ( $form[feature_den] ) { $letter .= "\t" . $form[feature_den] . "\n"; }
if ( $form[feature_laundry] ) { $letter .= "\t" . $form[feature_laundry] . "\n"; }
if ( $form[feature_fireplace] ) { $letter .= "\t" . $form[feature_fireplace] . "\n"; }
if ( $form[feature_dining] ) { $letter .= "\t" . $form[feature_dining] . "\n"; }
if ( $form[feature_pool] ) { $letter .= "\t" . $form[feature_pool] . "\n"; }
if ( $form[feature_porch] ) { $letter .= "\t" . $form[feature_porch] . "\n"; }
if ( $form[feature_skylight] ) { $letter .= "\t" . $form[feature_skylight] . "\n"; }
if ( $form[feature_bar] ) { $letter .= "\t" . $form[feature_bar] . "\n"; }
if ( $form[feature_vac] ) { $letter .= "\t" . $form[feature_vac] . "\n"; }
if ( $form[feature_suite] ) { $letter .= "\t" . $form[feature_suite] . "\n"; }
if ( $form[feature_fence] ) { $letter .= "\t" . $form[feature_fence] . "\n"; }
}
if ( $form[schools] ) { $letter .= "\nPreferred school(s): " . $form[schools] . "\n"; }
if ( $form[square_feet] ) { $letter .= "Desired Square Footage: " . $form[square_feet] . "\n"; }
if ( $form[price_range] ) { $letter .= "Desired Price Range: " . $form[price_range] . "\n"; }
if ( $form[sell_to_purchase] ) { $letter .= "Need To Sell To Purchase: " . $form[sell_to_purchase] . "\n"; }
if($form[comments]) {
$letter .= "\nMy comments are as follows:\n"; }
$letter .= "$form[comments]\n\n";
$letter .= "Thank you very much. I look forward to hearing from you.\n\n";
$letter .= "$form[name]\n\n";
mail("$final_recipient","$form[subject]","$letter", "Reply-To: $form[name] <$form[email]>\n");
print " Thank you!
";
print "Thank you for submitting your Dream Home Finder request.
";
print "Return to Welcome Page ";
} else {
print "
";
}
?>
|
|