How do you direct PHP output to another frame ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
FeralReason
Forum Newbie
Posts: 7
Joined: Mon Apr 20, 2009 11:05 pm

How do you direct PHP output to another frame ?

Post by FeralReason »

I have created a form in one frame and am trying to find a way to direct the output of my php script to the second frame when the user clicks on "submit".

1) I am willing to use either regular frames or iframes.
2) I am also willing to output to a file and make it the src of the 2nd frame -- however, I cannot seem to find a way to refresh the frame automatically when I do this.

Has anyone done something like this ? :?:
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do you direct PHP output to another frame ?

Post by requinix »

Set the target of the <form> to the frame you want.

Code: Select all

<form action="file.php" method="get" target="otherframe">
<!-- ... -->
</form>
 
<iframe name="otherframe"></iframe>
FeralReason
Forum Newbie
Posts: 7
Joined: Mon Apr 20, 2009 11:05 pm

Re: How do you direct PHP output to another frame ?

Post by FeralReason »

tasairis,

Works great ! Thank you very much.

Glenn
FeralReason
Forum Newbie
Posts: 7
Joined: Mon Apr 20, 2009 11:05 pm

Re: How do you direct PHP output to another frame ?

Post by FeralReason »

Tsaris,

Forgot to mention one thing. Had to change the method to "post". When I used "get" the output was truncated.

Thanx again ! :D
Post Reply