【发布时间】:2014-11-11 20:45:36
【问题描述】:
嗨,我想首先声明,我更像是一名设计师而不是一名开发人员。
我正在为一家包含 200 种不同食物类型的餐厅创建食物清单。
在 HTML 下方:
<form name="htmlform" method="post" action="send.php">
<table class="hoverTable" width="300">
<tr><td><strong>CANAPES</strong></td><td></td></tr>
<tr><td width="200" >email</td><td><input name="email"type="text" style="width:200px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Caviar:Black & red</td><td><input name="Caviar"type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Cheese & Ham</td><td><input name="Cheese_Ham" type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Fetta</td><td><input name="Fetta"type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Goat & Cheese</td><td><input name="Goat_Cheese" type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Halloumi</td><td><input name="Halloumi"type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Labneh & Cucumber</td><td><input name="Labneh_Cucumber" type="text" style="width:50px;" placeholder="Qty"/></td></tr>
<tr><td width="200" >Pepper & Pate</td><td><input name="Pepper_Pate" type="text" style="width:50px;" placeholder="Qty"/></td></tr>
</table>
<div class="submit"><input type="submit" ID="submit" value="SUBMIT" ></div>
<input type="reset" value="RESET" ID="reset" >
列表继续包含 200 个名称。
我试图用我从互联网上收集的东西创建以下 php 表单:
<?php
if(isset($_POST['email'])) {
$email_to = "email@gmail.com";
$email_subject = "food";
foreach ($_POST as $Field=>$Value) {
if($Value != ''){
$body .= "$Field: $Value\n";
@mail($email_to, $email_subject, $email_message, $headers);
?>
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
die();
?>
但事情似乎不起作用..
非常感谢您的帮助
【问题讨论】: