tags:

views:

250

answers:

2

What I want to achieve is the following. A search is made from one IFrame "the form is loaded into this frame via the src atribute of iframe" the search query is then passed to another IFrame that redirects to a url with the query eg. www.test.com/index.php?query=test

Is this possible?

Currently my code looks as such

<iframe src="abc.php" name="iframe1">

</iframe>
<iframe name="iframe2">
    <?php
        var_dump($_GET);
    ?>
</iframe>

abc.php contains the following

<form method="get" action="#" target="iframe2">
<input type="text" name="searchtype" id="searchtype" />
<input type="submit" value="submit">
</form>
+1  A: 

Try this.

<form method="get" action="<?php $_SERVER['PHP_SELF']?>" target="iframe2">
<input type="text" name="searchtype" id="searchtype" />
<input type="submit" value="submit">
</form>
Chris Leah
@Chris Tried this, buit funny the form loads into the iframe2
Roland
+1  A: 

Untested (don't have PHP installed on this machine).

You are passing your submission form back to itself, and loading the result into iframe2, which is why you just see that form again in the other frame. So what you need to do is put your form processing logic into a second .php file, instead of inside your iframe tags, and then have the form's action be abcd.php (or whatever) and keep the target as iframe2.

Anthony
@Anthony, thanx dude, your solution worked 100%
Roland