De todos modos para agregar mas a tu post te voy a poner como hacerlo con el iframe si es así que es lo que deseas hacer o si tu cabeza esta dando vueltas con jQuery, pero si te recomiendo que aprendas jQuery que te va a quitar muchos problemas de encima.
Bueno pasando a tu pregunta, supongamos que tenemos un html donde esta el input donde se va a hacer el post que luce como el siguiente:
toIframe.html:
Código HTML:
Ver original<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css" media="screen"> html, body {
background-color: #000;
}
<form action="buscar.php" method="post" target="buscar"> <input type="text" name="contenido"/> <input type="submit" name="setvideo" Value="buscar"/>
y este es el código del iframe, buscar.php:
Código HTML:
Ver original<?php
if (isset($_POST['contenido'])){
echo$_POST['contenido'];
};
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css" media="screen"> html, body {
background-color: #fff;
}
<h1>Este es mi iframe
</h1>
Con este código cuando te hagas el post se ira a tu iframe y se refrescará con la nueva información.
Puntos importantes a remarcar:
- el post se hace a tu iframe en action="buscar.php"
- para que tu información se vaya al iframe usamos el atributo target="buscar" donde buscar es el id de tu iframe.
espero que con eso sea respondida tu pregunta, ya que preguntaste como enviar la información a un iframe.