我使用这种完全相同的方法制作了多个页面,但出于某种原因,无论我尝试了什么,我都无法将某些字段转移到电子邮件字段中。我完全没有得到任何数据。这是表单HTML
<form action="interest.php" method="post" > <!-- BEGIN cardetail Form -->
<table>
<tr>
<td width="50" class="alignRight" style="font-weight:bold;" >Year:</td>
<td width="10px"></td>
<td width="112"><p name="carYear">2011</p></td>
<td class="alignRight" style="font-weight:bold;" >Color:</td>
<td width="10px"></td>
<td><p name="carColor">Red</p></td>
</tr>
<tr>
<td class="alignRight" style="font-weight:bold;" >Make:</td>
<td width="10px"></td>
<td ><p name="carMake">Honda</p></td>
<td width="50" class="alignRight" style="font-weight:bold;">Trim:</td>
<td width="10px"></td>
<td>Car has some sort of trim on it.</td>
</tr>
<tr>
<td class="alignRight" style="font-weight:bold;" >Model:</td>
<td width="10px"></td>
<td><p name="carModel">Accord</p></td>
<td class="alignRight" style="font-weight:bold;">Miles:</td>
<td width="10px"></td>
<td><p>180,000</p></td>
</tr>
<tr>
</tr>
<tr>
<td class="alignRight" style="font-weight:bold;">Options:</td>
<td width="10px"></td>
<td colspan="4">
<p>
Power Windows,
Power Locks,
Keyless Entry,
Cruise Control,
Climate Control,
2.6L V-Tech
</p>
</td>
</tr>
<tr>
<td style="font-weight:bold;">Repairs/Maintenance:</td>
<td width="10px"></td>
<td colspan="4">Fuel line flush, Transmission flush, Coolant flush, Oil Change, New Oil Filter, New Fuel Filter, New Air Filter, New Radiator, Painted Driverside Door, New Tires, Brand New Wax Job, and Fully Detailed.</td>
</tr>
<tr>
<td class="alignRight"></td>
<td></td>
<td><a href="#top">Back to Top</a></td>
<td class="alignRight" style="font-weight:bold;">Price:</td>
<td></td>
<td class="price"><p><span class="price"><?php echo $carPrice; ?>$6,000</span><input class="showInterest" type="submit" name="showInterest" id="showInterest" value="Show Interest" /></td>
</tr>
</table>
</form> <!-- END cardetail Form -->
这是我试图将信息传输到的 php 代码。
<?php echo $_POST['carYear'] . " / " . $_POST['carMake'] . " / " . $_POST['carModel'] . " / " . $_POST['carColor']; ?>
现在,当我从服务器运行代码时,我得到的只是 3 个“/”。由于某种原因, $_POST 没有获取任何数据。我已经尝试将它传递给一个变量,并且只是插入示例中的数据。我究竟做错了什么?有没有我遗漏的小错字?