我有一个非常简单的联系表格(或者我是这么想的),但是 9 个联系字段中只有 2 个被发送到我的收件箱。奇怪的是,它是列表中的最后两个字段,尽管“发件人”电子邮件地址和主题工作正常。
<form id="quote" class="contact_form" action="contact.php" method="post">
<h2>Easy Contact Form</h2>
<h4>Personal</h4>
<label for="title">Title:</label>
<input type="text" name="title" id="title" required class="required" >
<label for="name">Full Name:</label>
<input type="text" name="fullname" id="fullname" required class="required" >
<label for="email">Email:</label>
<input type="email" name="email" id="email" required placeholder="jsmith@email.com" class="required email">
<label>Phone:</label>
<input type="text" name="phone" id="phone" />
<h4>Address</h4>
<label>House #:</label>
<input type="text" name="house" id="house" />
<label>Street:</label>
<input type="text" name="street" id="street" />
<label>Town/City:</label>
<input type="text" name="town" id="town" />
<label>Postcode:</label>
<input type="text" name="postcode" id="postcode" />
<h4>Lender</h4>
<label>Company Name:</label>
<input type="text" name="companyname" id="companyname" />
<input class="btn" type="image" src="images/submit_btn.jpg"/>
</form>
这是PHP:
<?php
$EmailFrom = $_REQUEST['email'];
$EmailTo = "me@email.com";
$Subject = "Information";
$Title = Trim(stripslashes($_POST['title']));
$Fullname = Trim(stripslashes($_POST['fullname']));
$Email = Trim(stripslashes($_POST['email']));
$Message = Trim(stripslashes($_POST['phone']));
$House = Trim(stripslashes($_POST['house']));
$Street = Trim(stripslashes($_POST['street']));
$Town = Trim(stripslashes($_POST['town']));
$Postcode = Trim(stripslashes($_POST['postcode']));
$Companyname = Trim(stripslashes($_POST['companyname']));
// validation
$validationOK=true;
if (!$validationOK) {
echo "Error";
exit;
}
// prepare email body text
$Body = "Title: ";
$Body .= $Title;
$Body .= "\n";
$Body .= "Fullname: ";
$Body .= $Fullname;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body = "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body = "house: ";
$Body .= $house;
$Body .= "\n";
$Body = "Street: ";
$Body .= $Street;
$Body .= "\n";
$Body = "Town: ";
$Body .= $Town;
$Body .= "\n";
$Body = "Postcode: ";
$Body .= $Postcode;
$Body .= "\n";
$Body .= "Company Name: ";
$Body .= $Companyname;
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
echo "Succes";
}
else{
echo "Error";
}
?>