GT2007 Posted February 26, 2007 Share Posted February 26, 2007 Hello, I hope that someone can help me with a little problem I am having with form and iframe. What I am trying to do is use a form to submit to the page that it is on, and also to a page that is in an iframe that is on the same page. The problem that I am having is that the information from the form is only hitting the page that it is on and not sending the information to the page in the iframe. I am using this $item = $_POST['item']; on the main page, and it is also in the page that is being pulled up in the iframe. Here is the form: <form name="search" method="post"> <input name="item" type="text" value="" size="50" maxlength="100"> <input type="submit" name="Submit" value="Search"> </form> Here is the PHP info at the top of the page that the form is on, and the page that the iframe is calling: <?php include "config.php"; $item = $_POST['item']; if (!$item) {$item ="$DefaultItems";} ?> If you have any ideas to throw my way I sure would appreciate it TIA... Quote Link to comment Share on other sites More sharing options...
GT2007 Posted February 27, 2007 Author Share Posted February 27, 2007 So no one has a clue as to anything I can do with this to get things working? Could really use the help if there are any experts here that know about this. Thanks... Quote Link to comment Share on other sites More sharing options...
ashly Posted February 27, 2007 Share Posted February 27, 2007 As your form and iframe are in the same page, you are calling another page to iframe. so there is no possiblity to get the request variable in the called page. you have to pass the value of the $item to the called page each time. use something like this: $item = $_POST['item']; ...... <iframe src="mypage.php?item=<?= $item ?>"></iframe> Quote Link to comment Share on other sites More sharing options...
GT2007 Posted February 27, 2007 Author Share Posted February 27, 2007 Thank you very much Ashly That's what I needed Works like a charm now.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.