betoloco25 de Julio del 2003
PreguntaHola, voy empezando con PHP y entiendo (o creo entender como funcionan los formularios). Pero al probar cualquier ejemplo de los que ponen por aqui no me funciona. No se que está pasando pero, de hecho el interprete de PHP no me está procesando correctamente ningun formulario, es decir, no envía ningun tipo de información. ¿Qué podría estar ocurriendo?.
Por ejemplo...este simple formulario no se procesa adecuadamente (simplemente lo toma como si nunca hubiera introducido y enviado dato alguno y vuelve a mostrarme lo mismo cuando le doy enviar. Ayuda!!!¿QUE DEBO HACER?
<html>
<head>
<title>Cómo introducir información en un formulario</title>
</head>
<body>
<?
if ($Enviar)
{
echo "<br>Nombre: <b>".$first_name."</b><br>";
echo "<br>Apellidos: <b>".$last_name."</b>";
echo "<br>Dirección: <b>".$address."</b>";
echo "<br>Ciudad: <b>".$city."</b>";
echo "<br>Estado: <b>".$state."</b>";
echo "<br>Código Postal: <b>".$zip."</b>";
echo "<br>Teléfono: <b>".$home_phone."</b>";
// aki podeis procesar la informacion y poner el kodigo para todo lo ke kieras ke se haga sin ke se vea el formulario despues de ke hacen un Submit
}
else
{
?>
<form action="<? $PHP_SELF ?>" method="POST">
<p>Nombre: <input type="text" name="first_name">
<br>Apellidos: <input type="text" name="last_name">
<br>Dirección: <input type="tex" name="address">
<br>Ciudad: <input type="text" name="city">
<br>Estado: <input type="text" name"state">
<br>Código Postal: <input type="text" name="zip">
<br>Teléfono: <input type="text" name="home_phone">
<br><br><input type="submit" name="Enviar">
<input type="reset" name="Restablecer"></p>
</form>
<?
} // fin del if
?>
</body>
</html>
Por ejemplo...este simple formulario no se procesa adecuadamente (simplemente lo toma como si nunca hubiera introducido y enviado dato alguno y vuelve a mostrarme lo mismo cuando le doy enviar. Ayuda!!!¿QUE DEBO HACER?
<html>
<head>
<title>Cómo introducir información en un formulario</title>
</head>
<body>
<?
if ($Enviar)
{
echo "<br>Nombre: <b>".$first_name."</b><br>";
echo "<br>Apellidos: <b>".$last_name."</b>";
echo "<br>Dirección: <b>".$address."</b>";
echo "<br>Ciudad: <b>".$city."</b>";
echo "<br>Estado: <b>".$state."</b>";
echo "<br>Código Postal: <b>".$zip."</b>";
echo "<br>Teléfono: <b>".$home_phone."</b>";
// aki podeis procesar la informacion y poner el kodigo para todo lo ke kieras ke se haga sin ke se vea el formulario despues de ke hacen un Submit
}
else
{
?>
<form action="<? $PHP_SELF ?>" method="POST">
<p>Nombre: <input type="text" name="first_name">
<br>Apellidos: <input type="text" name="last_name">
<br>Dirección: <input type="tex" name="address">
<br>Ciudad: <input type="text" name="city">
<br>Estado: <input type="text" name"state">
<br>Código Postal: <input type="text" name="zip">
<br>Teléfono: <input type="text" name="home_phone">
<br><br><input type="submit" name="Enviar">
<input type="reset" name="Restablecer"></p>
</form>
<?
} // fin del if
?>
</body>
</html>
