php怎么读取textarea,在PHP中提取HTML表单TextArea

需要帮助理解为什么HTML5表单中的textarea(下面的“message”)字段没有被从PHP代码中抓取(用于创建电子邮件)。

HTML代码(法文):

Message pour des demandes de renseignements d'ordre
général seulement. Veuillez utiliser demande formulaire situé
sur la page Service pour commencer.

Nom

Courrier
Électronique

Téléphone

MESSAGE

PHP代码(contact.php):

/* Set e-mail recipient */

$myemail = "xxxxxx@gmail.com";

/* Check all form inputs using check_input function */

$yourname = check_input($_POST['name']);

$email = check_input($_POST['email']);

$telephone = check_input($_POST['telephone']);

$messaage = check_input($_POST["message"]);

/* If e-mail is not valid show error message */

if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))

{

show_error("E-mail address not valid");

}

/* Let's prepare the message for the e-mail */

$subject ="Comment received from website";

$content = "Hello!

The contact form from the website has been submitted by:

Name: $yourname

E-mail: $email

Telephone: $telephone

Message:$message

";

/* Send the message using mail() function */

mail($myemail, $subject, $content);

/* Redirect visitor to the thank you page */

header('Location: thanks.html');

exit();

/* Functions we used */

function check_input($data, $problem='')

{

$data = trim($data);

$data = stripslashes($data);

$data = htmlspecialchars($data);

if ($problem && strlen($data) == 0)

{

show_error($problem);

}

return $data;

}

function show_error($myError)

{

?>

Please correct the following error:

exit();

}

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值