Foros del Web » Programando para Internet » PHP »

La variable post no me funciona

Estas en el tema de La variable post no me funciona en el foro de PHP en Foros del Web. Tengo un problema con la funcion $_POST: Tengo este codigo : <!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; ...
  #1 (permalink)  
Antiguo 23/05/2012, 21:01
Avatar de zahirurzi  
Fecha de Ingreso: abril-2012
Mensajes: 1
Antigüedad: 12 años, 1 mes
Puntos: 0
Exclamación La variable post no me funciona

Tengo un problema con la funcion $_POST:


Tengo este codigo :

<!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>Documento sin título</title>
</head>

<body>
<form action="recibido.php.php" method="get">
<input type="text" name="txtNombre" />
<input type="text" name="txtApellido" />
<input type="submit" value="enviar" />
</form>
</body>
</html>


Y el php que lo recibe:


nombre: <?php echo $_GET['txtNombre'];?><br />
apellido: <?php echo $_GET['txtApellido'];?>



Este es el mensaje de error que me sale en el navegador:

Notice: Undefined index: txtNombre in C:\xampp\htdocs\recibido.php.php on line 9


Si alguien me puede ayudar les voy a agradecer...saludos
  #2 (permalink)  
Antiguo 23/05/2012, 21:27
 
Fecha de Ingreso: mayo-2012
Mensajes: 7
Antigüedad: 12 años
Puntos: 1
Respuesta: La variable post no me funciona

El error que veo es que tienes en action="recibido.php.php" deja solo un .php, intentalo y si algo vuelves y publicas ;)

Etiquetas: $_post, funciones
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:53.