My form mails but with no data. Can anybody spot what I am doing wrong? My html coding (separate program) uses POST as the form action. Here is the php program code:
<?php
$SendFrom = "Form Submission <
[email protected]>";
$SendTo = "
[email protected]";
$SubjectLine = "Get Involved Form Submission";
$ThanksURL = "thankyou.htm"; //confirmation page
$msg="Values submitted by the user:\n";
foreach($_POST as $key => $val){
if (is_array($val)){
$msg.="Item: $key\n";
foreach($val as $v){
$v = stripslashes($v);
$msg.=" $v\n";
}
} else {
$val = stripslashes($val);
$msg.="$key: $val\n";
}
}
$Msg.= "\n" . @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n" .
$_SERVER["HTTP_USER_AGENT"];
$MsgBody = htmlspecialchars($Msg, ENT_NOQUOTES); //make safe
// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $Msg, "From: $SendFrom");
header("Location: $ThanksURL");
?>