php - 邮寄半价
问题描述
当我提交表单时,字段值以家庭地址开头。一半的字段值未发送。
名字、姓氏、地区、电话、电子邮件未在邮件中发送。
<?php
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$area = $_POST["area"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$street1 = $_POST["street1"];
$street2 = $_POST["street2"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$new = $_POST["new"];
$email = $_POST["email"];
$already = $_POST["already"];
$time = $_POST["time"];
if($_POST["email"]){
$ToEmail = 'info@example.com';
$EmailSubject =' Example Title';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"];
$MESSAGE_BODY .=' First Name : '.$fname."\r\n";
$MESSAGE_BODY .=' Last Name : '.$lname."\r\n";
$MESSAGE_BODY .=' Phone Number : '.$area.' '.$phone."\r\n";
$MESSAGE_BODY .=' Email : '.$email."\r\n";
$MESSAGE_BODY .=' Home Address : '.$street1.' '.$street2."\r\n";
$MESSAGE_BODY .=' City : '.$city."\r\n";
$MESSAGE_BODY .=' State : '.$state."\r\n";
$MESSAGE_BODY .=' Zip : '.$zip."\r\n";
$MESSAGE_BODY .=' Looking for new service : '.$new."\r\n";
$MESSAGE_BODY .=' Already have service with another provider : '.$already."\r\n";
$MESSAGE_BODY .=' Select the best time : '.$time."\r\n";
$MESSAGE_BODY .= 'Service Interested in :'."\r\n";
if (isset($_POST['servicelist']) && !empty($_POST['servicelist'])) {
foreach($_POST['servicelist'] as $selected ){
$MESSAGE_BODY .= $selected."\r\n";
}
}
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
echo "Your message was sent";
header("refresh:2; url:index.php");
}
else{
echo "Sorry , No mail was sent";
}
?>
解决方案
推荐阅读
- amazon-web-services - 是否可以更改 AWS KMS CMK 的所有权?
- wordpress - 有没有办法阻止优惠被添加到订阅中
- docker - 在“terraform apply”上 ping docker 服务器时出错
- c++ - 使用 gtest 测试共享库 (.so)
- java - 旋转 Y 轴以翻转纹理朝向反转 X 轴
- python - 运行 AWS eb 状态时出现 Python 错误
- email - 带有 href 链接的电子邮件总是会成为垃圾邮件
- envoyproxy - kuma 禁用特使健康检查
- c# - 有没有办法通过另一个对象/小部件检测 MouseOver?
- python - 尝试运行已编译的 Cython 代码时出现“python39.dll not found”错误