Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/08/2013, 12:55
Avatar de guardarmicorreo
guardarmicorreo
 
Fecha de Ingreso: noviembre-2012
Ubicación: Córdoba
Mensajes: 1.153
Antigüedad: 11 años, 6 meses
Puntos: 84
Respuesta: seleccion de fila de tabla html

Cita:
Iniciado por pavilo Ver Mensaje
hola guardarmicorreo gracias por tu respuesta.

tendras algun ejemplo que puedes compartir ?

saludos
un ejemplo de formulario en una tabla.

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Ejemplo tabla + formulario</title>
  6. </head>
  7.  
  8. <body>
  9. <table align="center" border="1">
  10. <form method="post">
  11.     <tr>
  12.         <td>
  13.         Introduzca texto
  14.         </td>
  15.         <td>
  16.         <input type="text" name="texto" />
  17.         </td>
  18.     </tr>
  19.     <tr>
  20.         <td>
  21.         hombre
  22.         </td>
  23.         <td>
  24.         <input type="radio" name="sexo" value="hombre" />
  25.         </td>
  26.     </tr>
  27.     <tr>
  28.         <td>
  29.         mujer
  30.         </td>
  31.         <td>
  32.         <input type="radio" name="sexo" value="mujer" />
  33.         </td>
  34.     </tr>
  35.     <tr>
  36.         <td>
  37.         <input type="submit" name="enviar"/>
  38.         </td>
  39.     </tr>
  40. </form>
  41. </table>
  42. <?php
  43. if ( isset ( $_POST['enviar'] ) )
  44. {
  45.     if ( isset ( $_POST['texto'] ) && !empty ( $_POST['texto'] ) )
  46.     {
  47.         echo "El texto que ha introducido es: ". $_POST['texto'].". <br>";
  48.     }
  49.     else
  50.     {
  51.         echo "No ha introducido texto. <br>";
  52.     }
  53.     if ( isset ( $_POST['sexo'] ) && !empty ( $_POST['sexo'] ) )
  54.     {
  55.         echo "Su sexo introducido es: " . $_POST['sexo']. ".";
  56.     }
  57.     else
  58.     {
  59.         echo "No ha seleccionado su sexo.";
  60.     }
  61. }
  62. ?>
  63. </body>
  64. </html>
__________________
Ayúdame a hacerlo por mi mismo.

Última edición por guardarmicorreo; 18/08/2013 a las 13:03