私は簡単な質問がありますが、基本的にいくつかのコードを書いています。 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>
のようなHTMLを行うことができます。 –
...最初のヘッダーを印刷した後、テーブル行「」を閉じています...実際に開いているタグと閉じるタグを確認する必要があります... –
...また、 '$$ total'のようなドル記号。それは意図的なのでしょうか?あなたは本当にあなたのコードをより良く構造化し、それを見てすべてのエラーをキャッチしようとするべきです。 –