PHP电子邮件表单无法正常工作[关闭]

I'm using a PHP form for my website & I can't get it to send the email correctly, all it send me is the first and last name, but none of the other boxes, any help? Also how can I secure it?

This is the PHP file:

<!DOCTYPE html>
<html>
<body>
<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$paddress = $_POST['paddress'];
$cnumber = $_POST['cnumber'];
$bedrooms = $_POST['bedrooms'];
$furnished = $_POST['furnished'];
$unfurnished = $_POST['unfurnished'];
$partfurnished = $_POST['partfurnished'];
$townwork = $_POST['townwork'];
$distancework = $_POST['distancework'];
$when = $_POST['when'];
$maximum = $_POST['maximum'];
$additional = $_POST['additional'];

//Sending Email to form owner
$header = "From: $email
"
. "Reply-To: $email
";
$subject = "Property locator";
$email_to = "someone@domain.com";
$message = "Name: $fname . $lname
";
"Email: $email
";
"Postal Address: $paddress
";
"Contact Number: $cnumber
";
"Number of Bedrooms: $bedrooms
";
"Furnished, Unfurnished or Part Furnished: $furnished . $unfurnished . $partfurnished
";
"Which town will you be working in?: $townwork
";
"Preferred distance from property to work (miles): $distancework
";
"When do you need the accomodation?: $when
";
"Maximum rental per month(£): $maximum
";
"Additional information: $additional
";
mail($email_to, $subject ,$message ,$header ) ;

?>
<h1>Thank You for Your Submission</h1>
<p><a href="http://www.">Click here to go back</a></p>
</body>
</html>

Note the semicolon at the end of this line:

$message = "Name: $fname . $lname
";

it ends the statement, so the lines following it are not concatenated to $message.

This can solve your problem:

$message = "Name: $fname . $lname
" . 
  "Email: $email
" .
  "Postal Address: $paddress
" .
  "Contact Number: $cnumber
" .
  "Number of Bedrooms: $bedrooms
" .
  "Furnished, Unfurnished or Part Furnished: $furnished . $unfurnished . $partfurnished
" .
  "Which town will you be working in?: $townwork
" .
  "Preferred distance from property to work (miles): $distancework
" .
  "When do you need the accomodation?: $when
" .
  "Maximum rental per month(£): $maximum
" .
  "Additional information: $additional
";