PHP Code:
<?
/* The skeleton */
$who = $_POST['who'];
$typeOfInfo = $_POST['typeOfInfo'];
$nameOfWho = array(
1 => "Prospective insured",
"Prospective agent",
"Insured",
"Agent",
"Uknown Person"
);
$nameOfInfo = array(
1 => "Request Claim Information",
"Request information about my policy",
"Request information about obtaining my policy",
"Request my password",
"Comment on your website",
"Contact you on an unlisted topic"
);
$list = array(
"john.doe@mail.com",
"Homer.Sexual@moes.com",
"trustno1@aol.com",
"foo@bar.com",
"blah@the.net",
"president@whitehouse.gov"
);
$typeOfInfoPeople = array(
1=> array("$list[0], $list[2]", NULL, NULL, NULL, $list[5]),
array($list[1], $list[2], NULL, NULL, NULL, $list[5]),
array(NULL, $list[2], NULL, $list[5], NULL, $list[5]),
array(NULL, NULL, NULL, NULL, NULL, $list[5]),
array(NULL, NULL, list[3], NULL, NULL, $list[5]),
array("$list[0], $list[1]",
"$list[0], $list[2]",
"$list[0], $list[3]",
"$list[0], $list[4]",
"$list[0], $list[5]",
"$list[0], $list[1], $list[2], $list[3], $list[4], $list[5]"
);
$post = "$name, a ". $nameOfWho[$who].
" wants to ". $nameOfInfo[$typeOfInfo] .
":
Additional comment was:
$comment\n";
$mailing = $typeOfInfoPeople[$typeOfInfo][$who];
if (!$mailing)
die("We apologize. For the moment, we cannot provide feedback for ". $typeOfWho[$who]);
else {
mail($mailing,
"An information requested",
$post) or die("Mail session failed! The query was not sent, contact the administrator");
?>
the form will change slightly to simplify variables:
Bookmarks