Hey folks. This is my first time coding an HTML form, and after researching the various options for mailers, the kirupa PHP Form Mailer looked to be the simplest solution. The problem, however, is that this is also my first time working with PHP. I’ve got the form and the mailer both set to go according to the instructions, but hitting “submit” results in the page displaying a portion of the mailer code. Here’s my mailer.php file, with any sensetive information removed (matters of corporate security):
<?PHP
$to = "email@host.com";
$subject = “Adj Esc $date $time”;
$headers = "From: Agent;
$forward = 0;
$location = “”;
$date = date (“l, F jS, Y”);
$time = date (“h:i A”);
$msg = "Submitted at $date at $time.
";
if ($_SERVER[‘REQUEST_METHOD’] ==
“POST”) {
foreach ($_POST as $key =>
$value) {
$msg .= ucfirst ($key) ." :
". $value . "
";
}
}
else {
foreach ($_GET as $key =>
$value) {
$msg .= ucfirst ($key) ." :
". $value . "
";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header (“Location:$location”);
}
else {
echo "Your adjustment escalation
form has been submitted.";
}
?>
When I hit “Submit” on the form, it returns the following:
$value) { $msg .= ucfirst ($key) ." : ". $value . "
“; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) .” : ". $value . "
"; } } mail($to, $subject, $msg, $headers); if ($forward == 1) { header (“Location:$location”); } else { echo “Your adjustment escalation form has been submitted.”; } ?>
I’ve probably made a very newb mistake somewhere. Anyone care to help?