Min kode ser sådan ud:
<?php
if (!session_id()) {
session_start();
}//connect to the database
$connect = mysql_connect("xxxxx", "xxxxx", "xxxxx")
or die ("Hey loser, check your server connection.");
mysql_select_db("xxxxx_shop");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="library/fonts.xml" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table width="785" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="785" height="60" colspan="3"><img src="top.gif" width="785" height="60"></td>
</tr>
<tr>
<td width="785" height="1" colspan="3" bgcolor="#A99964"></td>
</tr>
<tr>
<td width="785" height="23" colspan="3"></td>
</tr>
<td width="385" height="472" valign="top" align="right"><img src="brud3_510x510p.jpg" width="385" height="472"></td>
<td width="15" height="472"></td>
<td width="385" height="472" class="indhold" valign="top" align="right">
<table width="385" height="472" border="0" valign="top" align="left" cellspacing="0" cellpadding="0">
<tr valign="middle" align="center">
<td height="420" align="left" valign="top"><div align="center"><font class="undermenu1_5"><br>Du har<b>
<?php
$sessid = session_id();
//display number of products in cart
$query = "SELECT * FROM carttemp WHERE carttemp_sess = '$sessid'";
$results = mysql_query($query);
$rows = mysql_num_rows($results);
echo $rows;
?>
</b>produkt(er) i din indkøbspose.<br>
</font>
<table width="385" border="0" align="center" cellpadding="5">
<tr>
<td width="65"><font class="undermenu1_5"><b>antal</b></font></td>
<td width="35"><font class="undermenu1_5"><b>vare</b></font></td>
<td width="70"><font class="undermenu1_5"><b>navn</b></font></td>
<td width="70"><font class="undermenu1_5"><b>stk. pris</b></font></td>
<td width="70"><font class="undermenu1_5"><b>pris i alt</b></font></td>
<?php
$total = 0;
while ($row = mysql_fetch_array($results)) {
echo "<tr>";
extract($row);
$prod = "SELECT * FROM products " .
"WHERE products_prodnum='$carttemp_prodnum'";
$prod2 = mysql_query($prod);
$prod3 = mysql_fetch_array($prod2);
extract($prod3);
echo "<td width=\"65\"><font class=\"undermenu1_5\">
<form method=\"POST\" action=\"modcart.php?action=change\">
<input type=\"hidden\" name=\"modified_hidden\"
value=\"$carttemp_hidden\">
<input type=\"text\" name=\"modified_quan\" size=\"1\"
value=\"$carttemp_quan\">";
echo "</font></td>";
echo "<td width=\"35\" valign=\"middle\"><font class=\"undermenu1_5\">";
echo "<a href=\"varerbeskrivelse.php?prodid=" . $products_prodnum . "\">";
echo "<img src=" . $products_thumbnailimageurl . " width=\"25\" height=\"25\" border=\"0\"></a></font></td>";
echo "<td width=\"70\" valign=\"middle\">";
echo "<a href=\"varerbeskrivelse.php?prodid=" . $products_prodnum . "\" class=\"undermenu1_5\">";
echo $products_navn;
echo "</font></a></td>";
echo "<td width=\"70\" valign=\"middle\" align=\"right\"><font class=\"undermenu1_5\">";
echo number_format($products_pris, 2 , ',' , '.');
echo "</font></td>";
echo "<td width=\"70\" valign=\"middle\" align=\"left\"><font class=\"undermenu1_5\">";
//get extended price
$extprice = number_format($products_pris * $carttemp_quan, 2 , ',' , '.');
echo $extprice;
echo "</font></td>";
echo "<td width=\"40\" align=\"right\">";
echo "<input type=\"submit\" name=\"Submit\"
value=\"ændre\">
</form></td>";
echo "<td width=\"35\" align=\"right\">";
echo "<form method=\"POST\" action=\"modcart.php?action=delete\">
<input type=\"hidden\" name=\"modified_hidden\"
value=\"$carttemp_hidden\">";
echo "<input type=\"submit\" name=\"Submit\"
value=\"slet\">
</form></td>";
echo "</tr>";
//add extended price to total
$total = $extprice + $total;
}
echo "<tr>";
echo "<td width=\"240\" colspan=\"4\" align=\"right\" class=\"undermenu1_5\"><b>Pris i alt(uden fragt):</b></td>";
?>
<?php echo "<td width=\"70\" colspan=\"2\" align=\"right\" class=\"undermenu1_5\"><b>"; ?><?php echo number_format($total, 2 , ',' , '.'); ?>
<?php
echo "</b></td>";
echo "<td width=\"75\" colspan=\"2\">";
echo "</td>";
echo "</tr>";
?>
</table>
<?php
echo "<table width=\"385\" border=\"0\">";
echo "<tr>";
echo "<td width=\"130\" align=\"right\"><form method=\"POST\" action=\"checkout.php\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"køb\">";
echo "</form></td>";
echo "<td width=\"255\" align=\"left\">";
echo "<form method=\"POST\" action=\"modcart.php?action=empty\">";
echo "<input type=\"hidden\" name=\"carttemp_hidden\" value=\"";
if (isset($carttemp_hidden)) {
echo $carttemp_hidden;
}
echo "\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"tøm indkøbspose\">
</form>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<a href="kollektion.php" class="undermenu1_5right">Tilbage til kollektion</a></font></div></td>
</tr>
</table> </td>
</tr>
<tr>
<td width="785" height="23" colspan="3"><img src="bund.gif" width="785" height="23"></td>
</tr>
<tr>
<td width="785" height="1" colspan="3" bgcolor="#A99964"></td>
</tr>
<tr>
<td width="785" height="20" colspan="3" align="center" class="indhold"><div align="center">copyright © 2006 la-femme all rights
reserved - powered by <font class="undermenu"><a href="
http://www.designunltd.dk" class="undermenu">designunltd.dk</a></font></div></td>
</tr>
</table>
</body>
</html>