Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/09/2010, 16:58
sandinosaso
 
Fecha de Ingreso: julio-2008
Mensajes: 208
Antigüedad: 15 años, 10 meses
Puntos: 5
Respuesta: quiero entender

Pasa que entra al else siempre porque no esta definida la variable $_POST


Intenta:
Código:
<?php

if (isset($_POST['respuesta'])){

$try = $_POST['respuesta'];

if($try == 'calor')
{
		echo 'ahora continua con la sgte prueba';
}
else
{
	echo 'vas por tu segundo intento';
};

}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>tres intentos y hasta mañana</title>
</head>

<body>
<p>¿Que pasa si estas mucho tiempo al sol?</p>
<form name="formulario_1" action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
	<label for="textfield">Dame tu respuesta</label>
		<input type="text" name="respuesta" id="textfield">
    <label for="textfield">Enviar</label>
		<input type="submit" name="enviar" id="textfield" value="enviar">
</form>
</body>
</html>
Saludos.