Hi All,
I have a site hosted by a company that supplies an amendable script to accept data from a form and email it. This script works fine, except I have a check box with multiple values, and only one value is coming thru to the email. I have no idea what language the script is in, even though I've been able to configure it for my purposes. I'm guessing I need to loop round the check box value, but have no idea how to do this in the unknown language! Can anybody help? The script is as follows, the multiple check box is the last variable, names 'Camps':
<?PHP $fmt_Response=implode("", file("response.htt");
$fmt_Mail=implode("", file("Mail.htt");
while(list($Key, $Val)= each($HTTP_POST_VARS)) {
$fmt_Response=str_replace("{$Key}", $Val, $fmt_Response);
$fmt_Mail=str_replace("{$Key}", $Val, $fmt_Mail);
}
$name = $HTTP_POST_VARS["name"];
$address = $HTTP_POST_VARS["address"];
$phone = $HTTP_POST_VARS["phone"];
$email = $HTTP_POST_VARS["email"];
$age = $HTTP_POST_VARS["age"];
$sex = $HTTP_POST_VARS["sex"];
$Experience = $HTTP_POST_VARS["Experience"];
$TShirtSize = $HTTP_POST_VARS["TShirtSize"];
$Comments = $HTTP_POST_VARS["Comments"];
$Camps = $HTTP_POST_VARS["Camps"];
$mailText = "$fmt_Mail \n\t Name: $name \n\t Address: $address \n\t Phone Number: $phone \n\t E-Mail: $email \n\t Sex: $sex \n\t Experience: $Experience \n\t T-ShirtSize: $TShirtSize \n\t Comments: $Comments \n\t Interested in Camps: $Camps ";
mail($HTTP_POST_VARS["recipient"], $HTTP_POST_VARS["subject"], $mailText );
echo $fmt_Response;
?>
I have a site hosted by a company that supplies an amendable script to accept data from a form and email it. This script works fine, except I have a check box with multiple values, and only one value is coming thru to the email. I have no idea what language the script is in, even though I've been able to configure it for my purposes. I'm guessing I need to loop round the check box value, but have no idea how to do this in the unknown language! Can anybody help? The script is as follows, the multiple check box is the last variable, names 'Camps':
<?PHP $fmt_Response=implode("", file("response.htt");
$fmt_Mail=implode("", file("Mail.htt");
while(list($Key, $Val)= each($HTTP_POST_VARS)) {
$fmt_Response=str_replace("{$Key}", $Val, $fmt_Response);
$fmt_Mail=str_replace("{$Key}", $Val, $fmt_Mail);
}
$name = $HTTP_POST_VARS["name"];
$address = $HTTP_POST_VARS["address"];
$phone = $HTTP_POST_VARS["phone"];
$email = $HTTP_POST_VARS["email"];
$age = $HTTP_POST_VARS["age"];
$sex = $HTTP_POST_VARS["sex"];
$Experience = $HTTP_POST_VARS["Experience"];
$TShirtSize = $HTTP_POST_VARS["TShirtSize"];
$Comments = $HTTP_POST_VARS["Comments"];
$Camps = $HTTP_POST_VARS["Camps"];
$mailText = "$fmt_Mail \n\t Name: $name \n\t Address: $address \n\t Phone Number: $phone \n\t E-Mail: $email \n\t Sex: $sex \n\t Experience: $Experience \n\t T-ShirtSize: $TShirtSize \n\t Comments: $Comments \n\t Interested in Camps: $Camps ";
mail($HTTP_POST_VARS["recipient"], $HTTP_POST_VARS["subject"], $mailText );
echo $fmt_Response;
?>