Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/07/2009, 06:50
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: otra duda con formularios!

Prueba este codigo
En el mismo archivo php que estas trabajando.


Código HTML:
<html>

<head>
<title></title>
</head>
<body>
<P> INTRODUZCA SUS DATOS PERSONALES </P>
<form name="FORMULARIO1" action="<?=$_SERVER['PHP_SELF']?>" method="post">

<table width="24%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td width="24%">Nombre</td>
<td width="76%"><input name="nombre" type="text" id="nombre"></td>
</tr>
<tr>
<td width="24%">Apellido</td>
<td width="76%"><input name="Apellido" type="text" id="Apellido"></td>
</tr>
<tr>
<td width="24%">E-mail</td>
<td width="76%"><input name="Email" type="text" id="Email"></td>
</tr>
<tr>
<td> Estado Civil </td>
<td><select name="estado" id="estado">
<option value="soltero">Soltero</option>
<option value="casado">Casado</option>
<option value="divorciado">Divorciado</option>
<option value="viudo">Viudo</option>
</select></td>
</tr>
<tr>
<td>Numero de Hijos</td>
<td> 0 <input name="hijos" type="radio" value="0" checked>
1 <input name="hijos" type="radio" value="1">
2 <input name="hijos" type="radio" value="2">
3 <input name="hijos" type="radio" value="3">
</td>
</tr>
<td><input type="submit" nane"submit" value="enviar"></td>
<td>&nbsp</td>
</tr>
</table>
</form>
</body>
</html> 
mientras que el formB es el siguiente:
Código PHP:

foreach($_POST as $indice => $valor)
{
echo 
"$indice: $valor <br>";