Cita:
Iniciado por pavilo
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<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ejemplo tabla + formulario</title>
</head>
<body>
<table align="center" border="1">
<form method="post">
<tr>
<td>
Introduzca texto
</td>
<td>
<input type="text" name="texto" />
</td>
</tr>
<tr>
<td>
hombre
</td>
<td>
<input type="radio" name="sexo" value="hombre" />
</td>
</tr>
<tr>
<td>
mujer
</td>
<td>
<input type="radio" name="sexo" value="mujer" />
</td>
</tr>
<tr>
<td>
<input type="submit" name="enviar"/>
</td>
</tr>
</form>
</table>
<?php
if ( isset ( $_POST['enviar'] ) ) {
if ( isset ( $_POST['texto'] ) && !empty ( $_POST['texto'] ) ) {
echo "El texto que ha introducido es: ". $_POST['texto'].". <br>";
}
else
{
echo "No ha introducido texto. <br>";
}
if ( isset ( $_POST['sexo'] ) && !empty ( $_POST['sexo'] ) ) {
echo "Su sexo introducido es: " . $_POST['sexo']. ".";
}
else
{
echo "No ha seleccionado su sexo.";
}
}
?>
</body>
</html>