我正在尝试将我的html表单绑定到PHP邮件程序,并且由于某种原因,表单输入不存储在我的变量中。我试过遍地搜索,我看不出我做错了什么。任何帮助将不胜感激。
表单处理程序:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$date = trim($_POST["date"]);
$guests = trim($_POST["guests"]);
$description = trim($_POST["description"]);
}
形式:
<form role="form" class="text-center" method="POST" enctype="text/plain" action="index.php">
<div class="form-group">
<label for="name">Nombre</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="form-group">
<label for="email">Correo Electrónico</label>
<input type="email" class="form-control" id="email" name="email">
</div>
<div class="form-group">
<label for="date">Fecha del Evento</label>
<input type="date" id="date" class="form-control" name="date">
</div>
<div class="form-group">
<label for="guests">Número de Huéspedes</label>
<select class="form-control" id="guests" name="guests">
<option>1 - 2</option>
<option>3 - 4</option>
<option>5 - 6</option>
<option>7 - 8</option>
</select>
</div>
<div class="form-group">
<label for="description">Descripción de Evento</label>
<textarea class="form-control" id="description" rows="3" name="description"></textarea>
</div>
<div style="display: none;">
<label for="address">Address</label>
<input type="text" class="form-control" id="address" name="address">
</div>
<input type="submit" class="btn btn-default" value="Enviar">
</form>