如何将三个变量合并为一个


How to combine three variables into one?

我正在尝试使用bootstrap,HTML和PHP创建电子邮件表单。我这里有表格:

<form role="form-horizontal" method="post" action="formsubmit.php" style="width 70%">
  <div class="form-group">
    <label for="name">Name</label>
    <input type="text" class="form-control" id="name" name="name">
  </div>
  <div class="form-group">
    <label for="email">Email</label>
    <input type="email" class="form-control" id="email" name="email">
  </div>
<div class="form-group">
  <label for="comment">Comment:</label>
  <textarea class="form-control" rows="5" id="comment" name="comment"></textarea>
</div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>

现在我正在尝试对PHP进行编码,以便我收到一封包含响应的电子邮件。我已经尝试了下面的代码,但当我收到电子邮件时它是空白的。

<?php 
  $name = $_POST["name"];
  $email = $_POST["email"];
  $comment = $_POST["comment"];
  $message = $name . $email . $comment;
  mail("someone@example.com","New contact form completion", $message )  
?>

我的目标是弄清楚如何获得包含表单回复的电子邮件。

试试这个:

$message = print_r($_POST,1);