Ver Mensaje Individual
  #9 (permalink)  
Antiguo 13/06/2005, 15:30
Remsankar
 
Fecha de Ingreso: octubre-2003
Ubicación: Cerca de una wifi o 3G
Mensajes: 328
Antigüedad: 20 años, 6 meses
Puntos: 4
ya esta me atrase en responder pero mi codigo quedo asi



Código PHP:
<?php
$variable 
POST_to_GET();
echo 
$variable;

function 
POST_to_GET(){
    foreach(
$_POST as $key=>$valor) {
        if(isset(
$temp)){
            
$temp $temp."&".$key."=".$valor;
        }
        else{
            
$temp "?".$key."=".$valor;    
        }
    }
    return 
$temp;
}
?>



Código PHP:
if ($recalc==$lang['recalcularb']) {
$variable POST_to_GET(); //llamado a variable para convertir post en query get
$variable=str_replace ("text"""$variable); 
$variable=str_replace ("?"""$variable);
$trozos split ('[?=&]'$variable);
$r count($trozos);
$i=0;
$sql="select * from carrocompras where cookie='$idreg' ";
$result=mysql_query($sql,$link);
while(
$row mysql_fetch_array($result)) { 
$sql2 "UPDATE carrocompras SET cantidad = '".$trozos[$i+1]."' WHERE id = '".$trozos[$i]."' and cookie='$idreg' "
$i=$i+2;
mysql_query($sql2);} 
se supone que el form tiene por name=text$idcarro
donde $idcarro es cada uno de los items que agrega
el value=$cant es la cantidad de esos items

Gracias a todos por su ayuda, funciona perfect! ;)