У меня есть форма, расположенный в https://pnrbuilder.com/_popups/feedback_popup.htmlсодержимое текстовой области не размещения
форма использует пост, чтобы передать вход на страницу PHP, который отправляет по электронной почте с содержимым поста затем перенаправляет пользователя.
Вводные поля работают нормально, но содержимое textarea не попадает на электронную почту.
Любая идея, что я делаю неправильно?
РНР Страница:
<?php
/*
This first bit sets the email address that you want the form to be submitted to.
You will need to change this value to a valid email address that you can access.
*/
$webmaster_email = "[email protected]";
/*
This bit sets the URLs of the supporting pages.
If you change the names of any of the pages, you will need to change the values here.
*/
$feedback_page = "feedback_form.html";
$error_page = "error_message.html";
$thankyou_page = "thank_you.html";
/*
This next bit loads the form field data into variables.
If you add a form field, you will need to add it here.
*/
$EmailAddress = $_POST['EmailAddress'] ;
$IssueType = $_POST['IssueType'] ;
$Comments = $_POST['Comments'] ;
/*
The following function checks for email injection.
Specifically, it checks for carriage returns - typically used by spammers to inject a CC list.
*/
function isInjected($str) {
$injections = array('(\n+)',
'(\r+)',
'(\t+)',
'(%0A+)',
'(%0D+)',
'(%08+)',
'(%09+)'
);
$inject = join('|', $injections);
$inject = "/$inject/i";
if(preg_match($inject,$str)) {
return true;
}
else {
return false;
}
}
// If email injection is detected, redirect to the error page.
if (isInjected($EmailAddress)) {
header("Location: $error_page");
}
// If we passed the previous test, send the email then redirect to the thank you page.
else {
mail("$webmaster_email, test[email protected]", "Feedback",
$EmailAddress, $IssueType, $Comments);
header("Location: $thankyou_page");
}
?>
Если я ставлю ниже в верхней части моей страницы PHP это ДЕЙСТВИТЕЛЬНО эхо из содержимого текстового поля
echo $_POST["EmailAddress"];
echo $_POST["IssueType"];
echo $_POST["Comments"];
Не могли бы вы попробовать выводя '$ _POST' переменных * до * отправка их по электронной почте? Разве они не появляются? –
изменить выше: Да, область текста отображается до отправки по электронной почте – DelightedD0D
Пожалуйста, проверьте мой ответ ниже. Это должно сделать трюк для вас. ;-) –