Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/06/2008, 11:43
Avatar de xxrandyxx
xxrandyxx
 
Fecha de Ingreso: abril-2008
Ubicación: En mi casa
Mensajes: 143
Antigüedad: 16 años
Puntos: 2
Ayuda con Codigo Extraño

Código:
<?php // Manual de PHP  
session_start();  
session_register('itemsEnCesta');  
$item=$_POST['item'];  
$cantidad=$_POST['cantidad'];  
$itemsEnCesta=$_SESSION['itemsEnCesta'];  
if ($item){  
   if (!isset($itemsEnCesta)){  
      $itemsEnCesta[$item]=$cantidad;  
   }else{  
      foreach($itemsEnCesta as $k => $v){  
         if ($item==$k){  
         $itemsEnCesta[$k]+=$cantidad;  
         $encontrado=1;  
         }  
      }  
      if (!$encontrado) $itemsEnCesta[$item]=$cantidad;  
   }  
}  
$_SESSION['itemsEnCesta']=$itemsEnCesta; 
?>
Buenas tengo este codigo y quiero agregar un valor mas, tengo item y tengo cantidad, quisiera agregar precio y otras cosas mas, la verdad me he confundido, porfavor arreglene este codigo o diganme como le agrego una mas PLEASE!!!