我有一个简单的问题,基本上我已经写了一些代码,我已经写了一些php代码来显示一些html之前的代码,然后是一个页脚......问题在于HTML是显示在这里先页脚,然后表.. 我想表中显示,然后再HTML页脚.. 是我的代码我如何在html之前显示php代码
if($orderCount == 0){
echo "<p><strong> No orders pending. Please try again later.</strong></p>";
}
echo "<table border=\"1\">\n"echo "<tr> <th bgcolor=\"blue\"> Order Summary</th></tr>
<tr> <th bgcolor=\"blue\"> Title</th>
<th bgcolor=\"blue\"> Author</th>
<th bgcolor=\"blue\"> Format</th>
<th bgcolor=\"blue\"> Price</th>
</tr>";
for($i=0;$i<$orderCount;$i++){
echo "<tr>
<td> $titleArray[$i]</td>
<td>$authorArray[$i]</td>
<td>$formatArray[$i]</td>
<td> $$priceArray[$i]</td>
</tr>";
}
$total = number_format(array_sum($priceArray),2);
echo " <tr> <td bgcolor=\"blue\"> Total price</td><td> </td> <td> </td><td align=\"right\">$$total</td></tr>"
?>
<form action="myform.php" method="post">
<ul>
<li>Payment Information</li>
</ul>
<label for="customer name">Customer Name</label>
<input type="text" name="customername" id="customername"> <br />
<label for="address">Street Address</label>
<input type="text" name="city" id="city"> <br />
<label for="state">State</label>
<input type="text" name="state" id="state"> <br />
<label for="zip">Zip Code</label>
<input type="text" name="zip" id="zip"> <br />
<input type="submit" value="Confirm Order">
</form>
</body>
'当你用它做,它可能会更好地工作。 –
...并且在您打印完第一个标题后,您正在关闭表格行''...您确实需要检查您的打开和关闭标记... –
...您还有一堆双美元符号,如'$$ total'。那是故意的吗?你应该尝试更好地构建你的代码,并通过它来尝试捕获所有的错误。 –