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>
答案 0 :(得分:1)
您应该使用ob_get_contents()功能。
答案 1 :(得分:1)
你可以得到php并做这样的HTML
<?php
// some php code you had
?>
your html
<?php
// resume php code
?>