Foros del Web » Programando para Internet » PHP »

como llevarme en un post

Estas en el tema de como llevarme en un post en el foro de PHP en Foros del Web. necesito llevarme mis datos de un bucle y los datos de inputs text que estan dentro del mismo bucle a la siguiente pagina para lograr ...
  #1 (permalink)  
Antiguo 02/03/2005, 11:23
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación como llevarme en un post

necesito llevarme mis datos de un bucle y los datos de inputs text que estan dentro del mismo bucle a la siguiente pagina para lograr subir todos mis datos a una tabla porque sino lo tendria que hacer uno por uno y eso es mucho trabajo para el usuario como se podria hacer esto
  #2 (permalink)  
Antiguo 02/03/2005, 11:47
Avatar de lado2mx
Colaborador
 
Fecha de Ingreso: agosto-2001
Ubicación: Veracruz
Mensajes: 3.720
Antigüedad: 22 años, 8 meses
Puntos: 9
Tienes que definir cada campo de cada bucle que intentes formar. No importa el número de inputs que pongas, sino que todos pasen de manera correcta.

1. Tienes que predefinir (ya sea por parte tuya o del usuario) los bucles que necesitas. Defínelo como $bucle

2. En la base HTML, define un <form> tienes que hacer el bucle de todos los text area necesarios. Puedes hacerlo de esta manera, un bucle ya sea con for o while de php.

3. Antes que mandes la información a la otra página, oculta un input que te tenga el valor de $bucle.

4. Luego puedes redefinir con while y guardar todos los post que se han hecho con variables variables. Y luego los pones en arrays. Creo que con eso será suficiente para mandarlo para base de datos o texto.

Trata de plantearlo con PHP y te decimos.
  #3 (permalink)  
Antiguo 02/03/2005, 11:56
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación si entendi eso

entonces las variable del bucle las tengo que unir en una sola para trasnportarlos

pude ser asi

Código PHP:
$bucle = while($rows = ......asi asta terminar el bucle 
y tambien se iran los input text de cada uno de las filas

y otra a la hora que llegen con post los tengo que dividir

con substr e ir separando datos para que pueda mostrarlos o estoy entendiendo mal

Última edición por christopher1979; 03/03/2005 a las 11:11
  #4 (permalink)  
Antiguo 02/03/2005, 11:58
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación tambien te pongo el codigo que estoy haciendo a ver si con eso

aqui esta el codigo

Código PHP:
<?php

$obraclavefrente 
$_POST['obraclavefrente'];

$obranombrefrente $_POST['obranombrefrente'];

$ubicacionfrente $_POST['ubicacionfrente'];

$clavepartida $_POST['clavepartida'];

$frentecalle $_POST['frentecalle'];

$frentenumero $_POST['frentenumero'];

$frentecolonia $_POST['frentecolonia'];

$clavedestajista $_POST['clavedestajista'];

$nombredestajista $_POST['nombredestajista'];

$etapa $_POST['etapa'];

$partidafecha $_POST['partidafecha'];

$finalfecha $_POST['finalfecha'];

$ano $_POST['ano'];

$fecha $_POST['fecha'];

$clavepaquete $_POST['clavepaquete'];

$numeroestimacionletra $_POST['numeroestimacionletra'];

$numeroestimacion $_POST['numeroestimacion'];

$descpaquete $_POST['descpaquete'];

$connection mysql_connect("localhost","administrador","administrador");

    
mysql_select_db("destajos",$connection);

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida'",$connection);

    echo 
"<table>";

    echo 
"<tr><td><font color = \"blue\" size = \"3\" face = \"arial\"><b>ESTIMACIONES (PASO3)<b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table  width = \"900px\">";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>OBRA:</b></font><font color = \"green\" size = \"2\"><b>$obraclavefrente-$obranombrefrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FECHA:</b></font><font color =\"green\" size =\"2\"><b>$fecha</b></font></td>";

    echo 
"<td><font color =\"blue\" size = \"2\" face = \"arial\"><b>LOCALIDAD:</b></font><font color = \"green\" size = \"2\"><b>$frentecalle $frentenumero Col. $frentecolonia</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FRENTE:</b></font<td><font color = \"green\" size = \"2\"><b>$ubicacionfrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ETAPA:</b></font><font color = \"green\" size = \"2\"><b>$etapa</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>DESTAJISTA:</b></font><font color = \"green\" size = \"2\"><b>$clavedestajista-$nombredestajista</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>PERIODO DE:</b></font><font color = \"green\" size = \"2\"><b>$partidafecha</b></font>*<font color = \"blue\" size = \"2\" face = \"arial\"><b>AL:</b></font><font color = \"green\" size = \"2\"><b>$finalfecha $ano</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMANCION NUMERO:</b></font><font color = \"green\" size = \"2\"><b>**$numeroestimacion</b></font></Td></tr>";    

    echo 
"<tr><td><font color =\"blue\" size = \"2\" face = \"arial\"><b>TRABAJOS DE:</b></font><font color = \"green\" size = \"2\"><b>$clavepartida</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMACION NUMERO(con letra):</b></font><td><font color = \"green\" size = \"2\"><b>$numeroestimacionletra</b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table border = \"1\">";

    echo 
"<th><font size = \"2\"><b>Clave Concepto</b></font></th>";

    echo 
"<th><font size = \"2\"><b>Concepto</b></font></th>";
    
    echo 
"<th><font size = \"2\"><b>Unidad</b></font></th>";

    echo 
"<th><font size = \"2\"><b>Precio Unitario</b></th>";

    echo 
"<th><font size = \"2\"><b>Cantidad</b></th>";

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida' and descpaquete = '$descpaquete'",$connection);

$bucle=    while($rows mysql_fetch_assoc($datospaquete)){

        echo 
"<form name = \"datos\" method = \"POST\" action = \"estimacionpaso4.php\">";

        echo 
"<tr><td><font size = \"1\">$rows[claveconcepto]</td>";

        echo 
"<td><font size = \"1\">$rows[descconcepto]</font></td>";

        echo 
"<td><font size = \"1\">$rows[unidad]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[pu]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[cantidad]</font></td>";

        echo 
"<td><input type = \"text\" name = \"volumennuevo\" maxlenght = \"25\" size = \"10\"></td>";

        echo 
"<td><input type = \"text\" name = \"importenuevo\" maxlenght = \"25\" size = \"10\"></td>";

        echo 
"<td><input type = \"submit\" value = \"PASO (4)\"></td>";

$estimaciona mysql_query("SELECT ultimo FROM estimacion where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida'",$connection);
    
        while(
$rows1 mysql_fetch_assoc($estimaciona)){

        echo 
"<td><font size = \"1\">$rows1[volumenac]</font></td>";

        echo 
"<td><font size = \"1\">$rows1[importeac]</font></td>";

        echo 
"<td><input type = \"text\" name = \"suma1\"></td>";

        echo 
"<td><input type = \"submit\" value = \"PASO (4)\"></td></tr>";    

        echo 
"<input type = \"hidden\" name = \"obraclavefrente\" value = \"$obraclavefrente\">";

        

        echo 
"<form>";

        }

}
        
?>

Última edición por christopher1979; 03/03/2005 a las 11:07
  #5 (permalink)  
Antiguo 02/03/2005, 12:40
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación esto lo que me tento que llevar

si te das cuenta esto es un bucle y son datos relacionados con el bucle si te fijas despues de cantidad va volumen esa cantidad junto con los de antes van relacionados son datos de el no se si estoy haciendo bien el bucle y como voy extraer los datos del post para que cada uno vaya a su posicion eso es lo que no entiendo

Código PHP:
$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida' and descpaquete = '$descpaquete'",$connection);

        
$bucle = while($rows mysql_fetch_assoc($datospaquete)){

        echo 
"<tr><td><font size = \"1\">$rows[claveconcepto]</td>";

        echo 
"<td><font size = \"1\">$rows[descconcepto]</font></td>";

        echo 
"<td><font size = \"1\">$rows[unidad]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[pu]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[cantidad]</font></td>";

        echo 
"<td><input type = \"text\" name = \"volumennuevo[0][]\" maxlenght = \"25\" size = \"10\"></td>";

        echo 
"<td><input type = \"text\" name = \"importenuevo[1][]\" maxlenght = \"25\" size = \"10\"></td>";


Última edición por christopher1979; 03/03/2005 a las 11:08
  #6 (permalink)  
Antiguo 02/03/2005, 13:17
Avatar de lado2mx
Colaborador
 
Fecha de Ingreso: agosto-2001
Ubicación: Veracruz
Mensajes: 3.720
Antigüedad: 22 años, 8 meses
Puntos: 9
Ahí vas, vas bien, ahora trata de hacer el post, o sea, el archivo que tenga las variables variables...
  #7 (permalink)  
Antiguo 02/03/2005, 13:47
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación me sale error

Parse error: parse error, unexpected T_WHILE in /var/www/html/destaWeb/estimacionpaso3.php on line 89

sale exactamete donde pongo $blucle = while
Código PHP:
<?php

$obraclavefrente 
$_POST['obraclavefrente'];

$obranombrefrente $_POST['obranombrefrente'];

$ubicacionfrente $_POST['ubicacionfrente'];

$clavepartida $_POST['clavepartida'];

$frentecalle $_POST['frentecalle'];

$frentenumero $_POST['frentenumero'];

$frentecolonia $_POST['frentecolonia'];

$clavedestajista $_POST['clavedestajista'];

$nombredestajista $_POST['nombredestajista'];

$etapa $_POST['etapa'];

$partidafecha $_POST['partidafecha'];

$finalfecha $_POST['finalfecha'];

$ano $_POST['ano'];

$fecha $_POST['fecha'];

$clavepaquete $_POST['clavepaquete'];

$numeroestimacionletra $_POST['numeroestimacionletra'];

$numeroestimacion $_POST['numeroestimacion'];

$descpaquete $_POST['descpaquete'];

$connection mysql_connect("localhost","administrador","administrador");

    
mysql_select_db("destajos",$connection);

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida'",$connection);

    echo 
"<table>";

    echo 
"<tr><td><font color = \"blue\" size = \"3\" face = \"arial\"><b>ESTIMACIONES (PASO3)<b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table  width = \"900px\">";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>OBRA:</b></font><font color = \"green\" size = \"2\"><b>$obraclavefrente-$obranombrefrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FECHA:</b></font><font color =\"green\" size =\"2\"><b>$fecha</b></font></td>";

    echo 
"<td><font color =\"blue\" size = \"2\" face = \"arial\"><b>LOCALIDAD:</b></font><font color = \"green\" size = \"2\"><b>$frentecalle $frentenumero Col. $frentecolonia</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FRENTE:</b></font<td><font color = \"green\" size = \"2\"><b>$ubicacionfrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ETAPA:</b></font><font color = \"green\" size = \"2\"><b>$etapa</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>DESTAJISTA:</b></font><font color = \"green\" size = \"2\"><b>$clavedestajista-$nombredestajista</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>PERIODO DE:</b></font><font color = \"green\" size = \"2\"><b>$partidafecha</b></font>*<font color = \"blue\" size = \"2\" face = \"arial\"><b>AL:</b></font><font color = \"green\" size = \"2\"><b>$finalfecha $ano</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMANCION NUMERO:</b></font><font color = \"green\" size = \"2\"><b>**$numeroestimacion</b></font></Td></tr>";    

    echo 
"<tr><td><font color =\"blue\" size = \"2\" face = \"arial\"><b>TRABAJOS DE:</b></font><font color = \"green\" size = \"2\"><b>$clavepartida</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMACION NUMERO(con letra):</b></font><td><font color = \"green\" size = \"2\"><b>$numeroestimacionletra</b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table border = \"1\">";

    echo 
"<th><font size = \"2\"><b>Clave Concepto</b></font></th>";

    echo 
"<th><font size = \"2\"><b>Concepto</b></font></th>";
    
    echo 
"<th><font size = \"2\"><b>Unidad</b></font></th>";

    echo 
"<th><font size = \"2\"><b>Precio Unitario</b></th>";

    echo 
"<th><font size = \"2\"><b>Cantidad</b></th>";

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida' and descpaquete = '$descpaquete'",$connection);

    
$bucle= while($rows mysql_fetch_assoc($datospaquete)){

        echo 
"<tr><td><font size = \"1\">$rows[claveconcepto]</td>";

        echo 
"<td><font size = \"1\">$rows[descconcepto]</font></td>";

        echo 
"<td><font size = \"1\">$rows[unidad]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[pu]</font></td>";
        
        echo 
"<td><font size = \"1\">$rows[cantidad]</font></td>";

        echo 
"<td><input type = \"text\" name = \"volumennuevo[0][]\" maxlenght = \"25\" size = \"10\"></td>";

        echo 
"<td><input type = \"text\" name = \"importenuevo[1][]\" maxlenght = \"25\" size = \"10\"></td></tr>";
}


        echo 
"<form name = \"envio\" method = \"POST\" action = \"menu.php\">";

        echo 
"<input type = \"hidden\" name = \"bucle\" value = \"$bucle\">";

        echo 
"<input type = \"hidden\" name = \"clavefrente\" value = \"$obraclavefrente\">";

        echo 
"<input type = \"hidden\" name = \"nombrefrente\" value = \"$obranombrefrente\">";

        echo 
"<input type = \"hidden\" name = \"ubicacionfrente\" value = \"$ubicacionfrente\">";

        echo 
"<input type = \"hidden\" name = \"clavepartida\" value = \"$clavepartida\">";

        echo 
"<input type = \"hidden\" name = \"frentecalle\" value = \"$frentecalle\">";

        echo 
"<input type = \"hidden\" name = \"frentenumero\" value = \"$frentenumero\">";

        echo 
"<input type = \"hidden\" name = \"frentecolonia\" value = \"$frentecolonia\">";

        echo 
"<input type = \"hidden\" name = \"clavedestajista\" value = \"$clavedestajista\">";

        echo 
"<input type = \"hidden\" name = \"nombredestajista\" value = \"$nombredestajista\">";

        echo 
"<input type = \"hidden\" name = \"etapa\" value = \"$etapa\">";

        echo 
"<input type = \"hidden\" name = \"partidafecha\" value = \"$partidafecha\">";

        echo 
"<input type = \"hidden\" name = \"finalfecha\" value = \"$finalfecha\">";

        echo 
"<input type = \"hidden\" name = \"ano\" value = \"$ano\">";

        echo 
"<input type = \"hidden\" name = \"fecha\" value = \"$fecha\">";

        echo 
"<input type = \"hidden\" name = \"clavepaquete\" value = \"$clavepaquete\">";

        echo 
"<input type = \"hidden\" name = \"numeroestimacionletra\" value = \"$numeroestimacionletra\">";

        echo 
"<input type = \"hidden\" name = \"numeroestimacion\" value = \"$numeroestimacion\">";

        echo 
"<input type = \"hidden\" name = \"descpaquete\" value = \"$descpaquete\">";

        echo 
"<tr><td><input type = \"submit\" value = \"PASO (4)\"></td></tr>"

        

?>

Última edición por christopher1979; 03/03/2005 a las 11:10
  #8 (permalink)  
Antiguo 02/03/2005, 15:40
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación ya casi lo termino pero no logor hacer que guarde los datos en mi variable

ayuda ya casi termino no se si me puedan ayudar
  #9 (permalink)  
Antiguo 03/03/2005, 09:11
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación ayuda con este malvado tema

ayuda porfavor no sean malos
  #10 (permalink)  
Antiguo 03/03/2005, 10:32
 
Fecha de Ingreso: agosto-2002
Ubicación: Colón - Entre Rios - Argentina
Mensajes: 647
Antigüedad: 21 años, 8 meses
Puntos: 8
Cita:
$bucle= while($rows = mysql_fetch_assoc($datospaquete)){
Deberia ser directamente
Código PHP:
while($rows mysql_fetch_assoc($datospaquete)){/ 
Ademas te agrego unas sugerencias para simplificar tu codigo...
En ves de hacer tantas veces esto
$obraclavefrente = $_POST['obraclavefrente'];
con cada variable, puedes optar por utilizar import_request_variables()
http://ar2.php.net/manual/en/functio...-variables.php
de ese modo al hacer algo asi como
Código PHP:
import_request_variables("P""desde_post_"); // le pones el prefijo que gustes

/* puedes acceder a las variables del formulario con el prefijo que especificaste antes
$desde_post_obranombrefrente;
$desde_post_ubicacionfrente;
*/ 
En ves de hacer tantos echo para cada liinea de HTML podrias usar "heredoc"
http://ar2.php.net/manual/es/languag...syntax.heredoc
por ejemplo
Código PHP:
mysql_select_db("destajos",$connection);

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida'",$connection);
echo <<<HTML
<table>
<tr><td><font color = "blue" size = "3" face = "arial"><b>ESTIMACIONES (PASO3)<b></font></td></tr>;
</table><br><br>
HTML; 
Son solamente sugerencias que te ayudaran a no "perderte" cuando buscas algun error en el codigo.

Estaria bueno ademas que uses las etiquetes del foro [ PHP ] .... [ /PHP ] para que se coloree el codigo

Saludos
  #11 (permalink)  
Antiguo 03/03/2005, 10:45
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación

gracias por el concejos pero en donde va $bucle necesito llevarme los datos que estan adentro todos los del bucle en un solo input podras ayudarme y si lees lo de lado2mx necesito hacer una variable con lo que contenga el bucle pero no lo logro.
  #12 (permalink)  
Antiguo 03/03/2005, 12:53
Avatar de FuLaNo_  
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 20 años, 11 meses
Puntos: 2
pues la variable $bucle la debes setear DENTRO del while, no puedes setear una variable con while...

En lugar de hacer el while y luego mil echo ''; has algo asi

while($rows = mysql_fetch_assoc($datospaquete)){
$bucle= "
<tr><td><font size = \"1\">$rows[claveconcepto]</td>
<td><font size = \"1\">$rows[descconcepto]</font></td>
<td><font size = \"1\">$rows[unidad]</font></td>
<td><font size = \"1\">$rows[pu]</font></td>
<td><font size = \"1\">$rows[cantidad]</font></td>
<td><input type = \"text\" name = \"volumennuevo[0][]\" maxlenght = \"25\" size = \"10\"></td>
<td><input type = \"text\" name = \"importenuevo[1][]\" maxlenght = \"25\" size = \"10\"></td></tr>
";
}

O algo así...
__________________
I Love Programming...
  #13 (permalink)  
Antiguo 03/03/2005, 13:22
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación si ya voy entendiendo

una pregunta mas amigo y como podria sumar un dato que estoy colocando en el input y en ese momento se sume con una variable y se coloque en otra se puede eso como en excel
  #14 (permalink)  
Antiguo 03/03/2005, 13:27
Avatar de FuLaNo_  
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 20 años, 11 meses
Puntos: 2
mmm no entiendo lo que pides... sumar una variable a otra es posible, pero no se si te referis a sumar matematicamente o a sumar "agregar" algo:

Si quieres sumar 2 variables matematicamente tienes que hacer:
$result = $var+$var1;

si quieres "agregar" una variable a otra tienes que hacer;
$result = $var.$var1;

Si quieres agregar un texto a la variable puedes hacer:
$result = $var.' este seria el texto agregado';

En fin, explicate mejor asi te ayudan mejor :)
__________________
I Love Programming...
  #15 (permalink)  
Antiguo 03/03/2005, 13:45
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación

si mira tienes una variable

$x y sumar una dato que tu pones en un input type "text" logico que los dos datos son matematicos

$x = 1

y cuando el usuario captura en ese input text

no se 7 se va sumar automatico con la variable x que es uno

y asi en otra celda se puede decir va ir el resultado

seria asi la $dato = $x++lodel input pero no se como llamar ese dato que esta poniendo el usuario
  #16 (permalink)  
Antiguo 03/03/2005, 13:48
Avatar de FuLaNo_  
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 20 años, 11 meses
Puntos: 2
podrías hacerlo con javascript, con document.form.campo.value
__________________
I Love Programming...
  #17 (permalink)  
Antiguo 03/03/2005, 17:01
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación hola ahora lo del bucle

y la ultima compañero como extraigo todo lo que lleva la variable bucle porque me aparece vacia
  #18 (permalink)  
Antiguo 03/03/2005, 17:31
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación aqui esta con la variable bucle y nada

Código PHP:
<?php

$obraclavefrente 
$_POST['obraclavefrente'];

$obranombrefrente $_POST['obranombrefrente'];

$ubicacionfrente $_POST['ubicacionfrente'];

$clavepartida $_POST['clavepartida'];

$frentecalle $_POST['frentecalle'];

$frentenumero $_POST['frentenumero'];

$frentecolonia $_POST['frentecolonia'];

$clavedestajista $_POST['clavedestajista'];

$nombredestajista $_POST['nombredestajista'];

$etapa $_POST['etapa'];

$partidafecha $_POST['partidafecha'];

$finalfecha $_POST['finalfecha'];

$ano $_POST['ano'];

$fecha $_POST['fecha'];

$clavepaquete $_POST['clavepaquete'];

$numeroestimacionletra $_POST['numeroestimacionletra'];

$numeroestimacion $_POST['numeroestimacion'];

$descpaquete $_POST['descpaquete'];

$connection mysql_connect("localhost","administrador","administrador");

    
mysql_select_db("destajos",$connection);

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida'",$connection);

    echo 
"<table>";

    echo 
"<tr><td><font color = \"blue\" size = \"3\" face = \"arial\"><b>ESTIMACIONES (PASO3)<b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table  width = \"900px\">";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>OBRA:</b></font><font color = \"green\" size = \"2\"><b>$obraclavefrente-$obranombrefrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FECHA:</b></font><font color =\"green\" size =\"2\"><b>$fecha</b></font></td>";

    echo 
"<td><font color =\"blue\" size = \"2\" face = \"arial\"><b>LOCALIDAD:</b></font><font color = \"green\" size = \"2\"><b>$frentecalle $frentenumero Col. $frentecolonia</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>FRENTE:</b></font<td><font color = \"green\" size = \"2\"><b>$ubicacionfrente</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ETAPA:</b></font><font color = \"green\" size = \"2\"><b>$etapa</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>DESTAJISTA:</b></font><font color = \"green\" size = \"2\"><b>$clavedestajista-$nombredestajista</b></font></td></tr>";

    echo 
"<tr><td><font color = \"blue\" size = \"2\" face = \"arial\"><b>PERIODO DE:</b></font><font color = \"green\" size = \"2\"><b>$partidafecha</b></font>*<font color = \"blue\" size = \"2\" face = \"arial\"><b>AL:</b></font><font color = \"green\" size = \"2\"><b>$finalfecha $ano</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMANCION NUMERO:</b></font><font color = \"green\" size = \"2\"><b>**$numeroestimacion</b></font></Td></tr>";    

    echo 
"<tr><td><font color =\"blue\" size = \"2\" face = \"arial\"><b>TRABAJOS DE:</b></font><font color = \"green\" size = \"2\"><b>$clavepartida</b></font></td>";

    echo 
"<td><font color = \"blue\" size = \"2\" face = \"arial\"><b>ESTIMACION NUMERO(con letra):</b></font><td><font color = \"green\" size = \"2\"><b>$numeroestimacionletra</b></font></td></tr>";

    echo 
"</table><br><br>";

    echo 
"<table border = \"1\">";

    echo 
"<th><font size = \"2\"><b>Clave Concepto</b></font></th>"

    echo 
"<th><font size = \"2\"><b>Concepto</b></font></th>"
     
    echo 
"<th><font size = \"2\"><b>Unidad</b></font></th>"

    echo 
"<th><font size = \"2\"><b>Precio Unitario</b></th>"

    echo 
"<th><font size = \"2\"><b>Cantidad</b></th>"

    echo 
"<th><font size = \"2\"><b>Nuevo Volumen</b></th>"
    
    echo 
"<th><font size = \"2\"><b>Nuevo Importe</b></th></tr>"

$datospaquete mysql_query("SELECT * FROM paquetel where clavefrente = '$obraclavefrente' and clavepaquete = '$clavepaquete' and clavepartida = '$clavepartida' and descpaquete = '$descpaquete'",$connection);

        while (
$rows mysql_fetch_assoc($datospaquete)){

        
$bucle"

        <tr><td><font size=\"1\"></font></td>

        <td><font size = \"1\">$rows[claveconcepto]</font></td>

        <td><font size = \"1\">$rows[descconcepto]</font></td>

        <td><font size = \"1\">$rows[unidad]</font></td>
        
        <td><font size = \"1\">$rows[pu]</font></td>
        
        <td><font size = \"1\">$rows[cantidad]</font></td>

        <td><input type = \"text\" name = \"volumennuevo[0][]\" maxlenght = \"25\" size = \"10\"></td>

        <td><input type = \"text\" name = \"importenuevo[1][]\" maxlenght = \"25\" size = \"10\"></td></tr></table>

        "
;

}
    
        echo 
"<form name = \"envio\" method = \"POST\" action = \"menu.php\">";

        echo 
"<input type = \"hidden\" name = \"bucle\" value = \"$bucle\">";

        echo 
"<input type = \"hidden\" name = \"clavefrente\" value = \"$obraclavefrente\">";

        echo 
"<input type = \"hidden\" name = \"nombrefrente\" value = \"$obranombrefrente\">";

        echo 
"<input type = \"hidden\" name = \"ubicacionfrente\" value = \"$ubicacionfrente\">";

        echo 
"<input type = \"hidden\" name = \"clavepartida\" value = \"$clavepartida\">";

        echo 
"<input type = \"hidden\" name = \"frentecalle\" value = \"$frentecalle\">";

        echo 
"<input type = \"hidden\" name = \"frentenumero\" value = \"$frentenumero\">";

        echo 
"<input type = \"hidden\" name = \"frentecolonia\" value = \"$frentecolonia\">";

        echo 
"<input type = \"hidden\" name = \"clavedestajista\" value = \"$clavedestajista\">";

        echo 
"<input type = \"hidden\" name = \"nombredestajista\" value = \"$nombredestajista\">";

        echo 
"<input type = \"hidden\" name = \"etapa\" value = \"$etapa\">";

        echo 
"<input type = \"hidden\" name = \"partidafecha\" value = \"$partidafecha\">";

        echo 
"<input type = \"hidden\" name = \"finalfecha\" value = \"$finalfecha\">";

        echo 
"<input type = \"hidden\" name = \"ano\" value = \"$ano\">";

        echo 
"<input type = \"hidden\" name = \"fecha\" value = \"$fecha\">";

        echo 
"<input type = \"hidden\" name = \"clavepaquete\" value = \"$clavepaquete\">";

        echo 
"<input type = \"hidden\" name = \"numeroestimacionletra\" value = \"$numeroestimacionletra\">";

        echo 
"<input type = \"hidden\" name = \"numeroestimacion\" value = \"$numeroestimacion\">";

        echo 
"<input type = \"hidden\" name = \"descpaquete\" value = \"$descpaquete\">";

        echo 
"<table><tr><td><input type = \"submit\" value = \"PASO (4)\"></td></tr></table>"

        echo 
"</form>";

        
                 

?>
  #19 (permalink)  
Antiguo 03/03/2005, 17:33
Avatar de FuLaNo_  
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 20 años, 11 meses
Puntos: 2
en teoria poniendo solo un:
echo $bucle;

tendría que devolver todo el contenido, si no es así es porque algo estas haciendo mal.

PD: Para que haces tantos echo?, pon todo en uno solo...
__________________
I Love Programming...
  #20 (permalink)  
Antiguo 04/03/2005, 15:59
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación me pueden ayudar compañeros



esto es lo que necesito se que esta dificil
pero no se como hacer esto disculpen las molestias bajen la imagen es lo que necesito gracias amigos se los agradesco

Última edición por christopher1979; 04/03/2005 a las 16:07
  #21 (permalink)  
Antiguo 06/03/2005, 11:30
Avatar de christopher1979  
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación ayda con este tema

por favor ayudenme con este tema ya no se que hacer
  #22 (permalink)  
Antiguo 06/03/2005, 14:02
 
Fecha de Ingreso: marzo-2005
Mensajes: 3
Antigüedad: 19 años, 1 mes
Puntos: 0
Querido Christopher no se pueden mandar de nuevo las variables capturadas por post, pero lo que puedes hacer es almacenarlas de nuevo en un imput de tipo hidden para que no se vean en tu pagina si es que no quieres.

Ejemplo
<input name="nombre-cualquiera" type="hidden" id="nombre-cualquiera" value="<?=$_POST['variable-post']?>">

entonces puedes hacer lo que quieras dentro de tu pagina y luego podras mandar las mismas variables hidden a otra pagina para luego ser utilizadas y capturadas por post.

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:43.