Ver Mensaje Individual
  #8 (permalink)  
Antiguo 09/03/2007, 06:44
Avatar de HMSJUAN
HMSJUAN
 
Fecha de Ingreso: febrero-2007
Mensajes: 54
Antigüedad: 17 años, 2 meses
Puntos: 1
Re: problema con formulario

Bamos Ahora A resolver tu probema:

Arcivo formulario.php
Código PHP:
<html>
<head>
<title>Adivina</title>
</head>

<body>
<table width="22%" border="1">
  <tr>
    <td width="13%">Producto</td>
    <td width="13%">Cantidad</td>
    <td width="74%">&nbsp;</td>
  </tr>
  
  <?php    
  
//Haces tu coneccion y tu consulta de la fdorma que desees 
  
$consulta="select * from trabla";
  
$resultado=mysql_query($consulta);
  while (
$fila=mysql_fetch_array($resultado)){
  
?>
  <form name="como" method="post" action="pagina2.php">
  <tr>
    <td><input type="hidden" value="<?=$fila["codigo"]?>" name="codigo"/> <?=$fila["nombreproducto"]?></td>
    <td><input type="text" name="cantidad"  /> </td>
    <td><input  type="submit" value="Agregar"  /></td>
  </tr>
  <?
            
//final de bucle
  
mysql_free_result();
   
?>
  
</table>
</body>
</html>
Ahora la pagiina que recibe el formulario.....
pagina2.php

Código PHP:
 
echo "Producto ".$_POST["codigo"]." Cantidad =".$_POST["cantidad"];
// Luego haces lo que desee 

Por favor informanos si te funciono, mejoralo y luego lo compartes