Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/05/2008, 13:27
Avatar de sumolari
sumolari
 
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Que codigo poner?

Tienes un par de errores, mira, los corrijo y así ves que es lo que tenías mal:

Archivo: "pagina_del_producto.php"
Código PHP:
<?
include("lib_carrito.php");
?>
<form action="agregar_producto.php?id=1&nombre=Nombre+Del+Producto&precio=125$" method="post" name="form1">
  <table width="164" border="0" align="left">
    <tr>
      <td width="61">Cantidad:</td>
      <td width="29"><input name="cantidad" type="text" id="cantidad" value="1" size="4" maxlength="3"></td>
      <td width="96"><input name="submit" type="submit" id="submit" value="Agregar"></td>
    </tr>
  </table>
</form>
Archivo: "agregar_producto.php"
Código PHP:
<?
include("lib_carrito.php");
$_SESSION["ocarrito"]->introduce_producto($_GET["id"], $_GET["nombre"], $_GET["precio"], $_POST["cantidad"]);
?>
Con ese cambio debería funcionar.