我有一个位于https://pnrbuilder.com/_popups/feedback_popup.html的表格
该表单使用 post 将输入传递给一个 php 页面,该页面发送一封包含帖子内容的电子邮件,然后重定向用户。
输入字段工作正常,但 textarea 内容无法发送到电子邮件。
知道我做错了什么吗?
PHP页面:
<?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 = "support@email.com";
/*
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.com", "Feedback",
$EmailAddress, $IssueType, $Comments );
header( "Location: $thankyou_page" );
}
?>
如果我将下面的内容放在我的 php 页面的顶部,它会回显 textarea 的内容
echo $_POST["EmailAddress"];
echo $_POST["IssueType"];
echo $_POST["Comments"];