| | |
Form in one iFrame refreshes another iFrame
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I have a page that holds two iFrames. The first iFrame is a form the user has to fill out. The second iFrame prints the results the form gives. When the page is first loaded with the two iFrames, I want the second to hold a default page that says "Please Fill Out The Form". Once they do and hit submit, I want the the second frame to change to the results. My form works, and when you first load the page it seems to work, however, once I hit submit, it sends to a new page that just shows the results. Please advise, thanks.
The way the link shows is how I thought I was suppose to do it, but it doesn't work. Here are the iFrames......
Here is the first line of the form....
I am not sure what I might be doing wrong with it. The page that houses the iFrames is ...getLinkBack.php. I then have my functions under another folder obviously and I have the form send the info to the linkBackCode.php. In that file, if there is not new URL, it post the phrase "PLEASE FILL OUT FORM". Once someone fills out the form, I want it to refresh that iFrame, not open a new window with the new call. Does that make sense? Thanks for the help.
PHP Syntax (Toggle Plain Text)
<td width="580" valign="top" align="center"> <iframe name="LinkBackForm" width="600" height="400" align="middle" src="linkForm.php" frameborder="0" ></iframe> </td> </tr> <tr align="center"> <td width="580" valign="middle" align="center"> <iframe name="URL" width="500" height="200" align="middle" src="functions/linkBackCode.php" frameborder="1"></iframe> </td>
Here is the first line of the form....
PHP Syntax (Toggle Plain Text)
<form action="functions/linkBackCode.php" method="get" target="URL" >
I am not sure what I might be doing wrong with it. The page that houses the iFrames is ...getLinkBack.php. I then have my functions under another folder obviously and I have the form send the info to the linkBackCode.php. In that file, if there is not new URL, it post the phrase "PLEASE FILL OUT FORM". Once someone fills out the form, I want it to refresh that iFrame, not open a new window with the new call. Does that make sense? Thanks for the help.
Last edited by Roebuc; Jun 20th, 2008 at 4:10 pm.
I ran a test and it works for me, here is my code
file:test.php
file:test1.php
file:test2.php
file:test.php
html Syntax (Toggle Plain Text)
<!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=utf-8" /> <title>Untitled Document</title> </head> <body> <table> <tr> <td width="580" valign="top" align="center"> <iframe name="LinkBackForm" width="600" height="400" align="middle" src="test1.php" frameborder="0" ></iframe> </td> </tr> <tr align="center"> <td width="580" valign="middle" align="center"> <iframe name="URL" width="500" height="200" align="middle" src="test2.php" frameborder="1"></iframe> </td> </tr> </table> </body> </html>
file:test1.php
html Syntax (Toggle Plain Text)
<!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=utf-8" /> <title>Untitled Document</title> </head> <body> <form target="URL" action="test2.php" method="get"> <input type="text" name="txtOne" /><br /> <input type="text" name="txtTwo" /><br /> <input type="submit" name="btnSubmit" /> </form> </body> </html>
file:test2.php
php Syntax (Toggle Plain Text)
<? if(count($_POST) > 0) { print_r($_POST); echo "<br />"; } if(count($_GET) > 0) { print_r($_GET); echo "<br />"; } ?> This is frame 2
Last edited by R0bb0b; Jun 20th, 2008 at 4:36 pm.
![]() |
Similar Threads
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: how to save TAB delimited list
- Next Thread: Uploading with PHP error
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array basic beginner binary broken cakephp checkbox class cms code computing cron curl database date delete directory display domain download dynamic echo email error file files folder form forms function functions google href htaccess html image include indentedsubcategory insert integration ip java javascript joomla limit link load login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote return script search select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube






