solo le agregaria el id del producto y la cantidad que va a comprar y el importe que seria cantidad por el precio del producto.
Necesito ayuda URGENTE este trabajo me lo dejo un profe =(
|
|
#1 (permalink) |
![]() Fecha de Ingreso: febrero-2008
Mensajes: 4
|
solo le agregaria el id del producto y la cantidad que va a comprar y el importe que seria cantidad por el precio del producto. Necesito ayuda URGENTE este trabajo me lo dejo un profe =( |
|
|
|
|
|
#2 (permalink) |
![]() Fecha de Ingreso: febrero-2008
Mensajes: 4
|
Re: hacer carrito de compras en JSP
en PHP lo hacia con una SESION de usuario
<? session_start(); echo "Usuario : ".$_SESSION["suser"]."<p>"; $cantidad=count($_SESSION["scompra"]); if($cantidad==0) { echo "Usted no realizo ninguna compra"; } else { foreach($_SESSION["scompra"] as $indice=>$contenido) { echo $indice." ".$contenido."<br>"; } } ?> <table width="327" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="196" height="25"><a href="agregar.php">Agregar Articulo</a></td> <td width="153"><a href="cerrar.php">Cerrar Sesion </a></td> </tr> </table> <a href="agregar.php"></a> <a href="cerrar.php"></a> mi clase AGREGAR en PHP era la siguiente <? session_start(); if(!isset($_POST["control"])) { ?> <?php echo "<b>"."Usuario: ".$_SESSION["suser"]. " "."<br>";?> <style type="text/css"> <!-- .Estilo8 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .Estilo9 {font-size: 12px} .Estilo10 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; } --> </style> <form name="form1" method="post" action=""> <input type="hidden" name="control"> <table width="309" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666"> <tr> <td width="305" height="121"><table width="274" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"><span class="Estilo10">Compras Online </span></td> </tr> <tr> <td width="84" height="27"><span class="Estilo8">Articulo</span></td> <td colspan="2"><input name="articulo" type="text" id="articulo"></td> </tr> <tr> <td height="29"><span class="Estilo8">Cantidad</span></td> <td colspan="2"><input name="cantidad" type="text" id="cantidad"></td> </tr> <tr> <td height="32"><span class="Estilo9"></span></td> <td colspan="2" align="right" valign="middle"><input name="Submit" type="submit" value="Enviar"></td> </tr> </table></td> </tr> </table> </form> <? }else { $articulo=$_POST["articulo"]; $cantidad=$_POST["cantidad"]; $_SESSION["scompra"][$articulo]=$cantidad; header( "location: compras.php" ); } ?> <a href='compras.php'> Volver a Compras </a> me pregunto como podre hacerlo en JSP |
|
|
|
![]() |
| Herramientas | |
| Desplegado | |
|
|