![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/03/2011, 19:51
|
| | Fecha de Ingreso: agosto-2010 Ubicación: mexico
Mensajes: 125
Antigüedad: 14 años, 5 meses Puntos: 0 | |
Respuesta: que error tengo? php Listo solo compialo en lugar del que tienes y a tu archivo tienes que tener el mismo nombre de la accion del formulario ok suerte
cual quier cosa aqui nadamos y si queda cierra tu tema.
<html>
<head>
<title>Inetero</title></head>
<body>
<form action="pruebas12.php" method="post">
<p>Hombre
<input type="radio" name="sexo" value="0">
Mujer
<input type="radio" name="sexo" value="1">
</p>
<p>
<input type="text" name="nombre" >
<input type="submit" name="submitbutton" value="probar">
</p>
</form></p>
<?php
if (isset($_POST['sexo']) && isset($_POST['nombre']) && $_POST['nombre'] != "") {
if ($_POST['sexo'] == 0) {
echo "Hola Sr. ";
} else {
echo "Hola Sra. ";
}
echo "<b>{$_POST['nombre']}</b> bienvenido a la web.";
} else {
if (isset($_POST['submitbutton'])) {
echo "<b>Porfavor rellena todos los campos.</b>";
}
}
?>
</p>
</body>
</html> |