
21/06/2009, 05:24
|
| | Fecha de Ingreso: junio-2009
Mensajes: 7
Antigüedad: 15 años, 8 meses Puntos: 0 | |
error en carrito Hola, tengo echo un carrito en php y me da error en la linea 64 :S que es donde termina </html> y tambien querria saber como puedo poner que el carrito sea privado, es decir, que solo lo puedan ver los usuarios registrados en mi pagina web. weno aqui os dejo el codigo gracias de antemano
<?php
session_start();
if(isset($_SESSION['carro']))
$carro=$_SESSION['carro'];else $carro=false;
?>
<html>
<body>
<h1 align="center"> Tu Carrito </h1>
<?php
if($carro){
?>
<table width="100%" height="95%" align="center" border="1">
<tr align="center">
<td> Quitar
<td> Nombre
<td> Precio
<td> Cantidad
</tr>
<?php
$contador=0;
$suma=0;
foreach($carro as $a => $b){
$subtotal=$b['stock']*$b['precio'];
$suma=$suma+$subtotal;
$contador++;
?>
<form name="a <?php echo $b['identificador'] ?>" method="post" action="agregar.php?<?php echo SID ?>" id="a<?php echo $b['identificador'] ?>">
<tr>
<td> <a href="borrar.php?<?php echo SID ?>&id=<?php echo $v['id_producto'] ?>"><img src="borrar.gif"></a>
<td> <?php echo $b['nombre'] ?>
<td> <?php echo $b['precio'] ?>
<td align="center"> <?php echo $b['cantidad'] ?>
<td> <input name="cantidad" type="text" id="cantidad" value="<?php echo $b['stock'] ?>" size="8">
<input name="id" type="hidden" id="id" value="<?php echo $b['id_producto'] ?>">
</tr>
</form>
<tr>
<td>
<td>
<td> Subtotal:
<td> <?php echo number_format($suma,2); ?>
</tr>
</table>
<br> <br>
<table align="center">
<tr>
<td> <a href="fin.html" target="Principal"> <img src="compraya.gif"></a>
<td> <a href="productos.html" target="Principal"> <img src="continuar.gif"></a>
<td> <a href=" " target="Principal"> <img src="actualizar.jpg"></a>
</tr>
</table>
</body>
</html> |