Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/09/2010, 19:23
lyepes89
 
Fecha de Ingreso: septiembre-2010
Mensajes: 20
Antigüedad: 13 años, 8 meses
Puntos: 1
Respuesta: como capturar el contenido de una caja de texto con php sin refrescar la p

Cita:
Iniciado por Perr0 Ver Mensaje
materiales:
2 paginas php (o al menos la que contiene el frame)

en la pagina principal de nombre "index.php", colocas este código:
Código HTML:
<!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=iso-8859-1" />
<title>Documento sin título</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="iframe.php" target="miframe">
  <input type="text" name="texto_a_iframe" id="texto_a_iframe" />
  <input type="submit" name="button" id="button" value="Enviar" />
</form>
<p>Abajo iframe:<br />
<iframe width="400" height="100" frameborder="1" src="iframe.php" name="miframe"></iframe>
</p>
</body>
</html> 

la segunda pagina la llamaremos "iframe.php" y copias y pegas esto:
Código PHP:
<!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=iso-8859-1" />
<title>Documento sin título</title>
<style>
body{
    background-color:#FFFF80
}
</style>
</head>

<body>
<?
$t
=$_POST["texto_a_iframe"];
if(!
$t)
print 
"esperando variable...";
else
print 
"variable -> ".$t;
?>
</body>
</html>
dejalo a fuego lento 3 minutos y lo haces correr...si seguiste las instrucciones estaria ok

en este trabajo No se uso
- ajax
- dom
- sessiones
- javascript

salu2

Gracias por contestar, pero lo que pasa es que ahora necesito pasar esa variable capturada en el iframe a otro iframe que esta oculto, como lo hago??? intente con variables de session pero el navegador se queda cargando y no responde