don said:
I have a form which when the user clicks the submit button it calls another
page which generates some stuff - however, on this second page I have an
iframe which generates a table which needs the variables from the first page
passed to it - is there a way to do this?
Yes. Let's call the first page "pagea.html", the second page "pageb.php"
and the iframe thats inserted into the second page "iframe.php". And the
data that we're passing around is called "query".
Examples use PHP, but the same basic idea will work in other server-side
languages too.
================ pagea.html ================
<form action="pageb.php" method=get>
<div>
<input name=query>
<input type=submit>
</div>
</form>
============================================
================ pageb.php =================
<?php
$query = ($_GET['query']?$_GET['query']:'BLANK');
$qurl = htmlentities(urlencode($query));
?>
<p>Query was <tt><b><?=$query?></b></tt>.</p>
<iframe name=foo height=100 width=200 src="iframe.php?query=<?=$qurl?>">
Your browser does not support <code>iframe</code>.<br>
Please go to the <a href="iframe.php?query=<?= $url ?>">page</a>
manually.
</iframe>
============================================
================ iframe.php ================
<?php
$query = ($_GET['query']?$_GET['query']:'BLANK');
?>
<p>Query was <tt><b><?=$query?></b></tt>.</p>
============================================