Specifications
<td>Price:</td>
<td><input type=text name=price
value=”<?=$edit?$book[“price”]:””; ?>”></td>
</tr>
<tr>
<td>Description:</td>
<td><textarea rows=3 cols=50
name=description>
<?=$edit?$book[“description”]:””; ?>
</textarea></td>
</tr>
<tr>
<td <? if (!$edit) echo ”colspan=2”; ?> align=center>
<?
if ($edit)
// we need the old isbn to find book in database
// if the isbn is being updated
echo “<input type=hidden name=oldisbn
value=\””.$book[“isbn”].”\”>”;
?>
<input type=submit
value=”<?=$edit?”Update”:”Add”; ?> Book”>
</form></td>
<?
if ($edit)
{
echo “<td>”;
echo “<form method=post action=\”delete_book.php\”>”;
echo “<input type=hidden name=isbn
value=\””.$book[“isbn”].”\”>”;
echo “<input type=submit
value=\”Delete book\”>”;
echo “</form></td>”;
}
?>
</td>
</tr>
</table>
</form>
<?
}
Building a Shopping Cart
C
HAPTER 25
25
B
UILDING A
SHOPPING CART
583
LISTING 25.19 Continued
31 7842 CH25 3/6/01 3:39 PM Page 583










