How to redirect php output to another iFrame

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
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

How to redirect php output to another iFrame

Post by amir »

Hi everybody,

How can I redirect php output (echo or print) to another iFrame?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You don't. The iframe should make the request to receive the output.
User avatar
Cameri
Forum Commoner
Posts: 87
Joined: Tue Apr 12, 2005 4:12 pm
Location: Santo Domingo, Dominican Republic

Post by Cameri »

Well, I suggest you learn AJAX, that's the only way you can do what you are asking.
AJAX stands for: Asynchronous Javascript + XML.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Cameri wrote:Well, I suggest you learn AJAX, that's the only way you can do what you are asking.
AJAX stands for: Asynchronous Javascript + XML.
I'll have to differ on that. Ajax is not the only solution to performing this as I alluded to in my post.
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

You don't. The iframe should make the request to receive the output.
No, it is possible to do this and one the ways is as follows:
1) you create a span in the target iFrame
2) create needed text strings with php
3) echo the jscript reference to the span as jscript function

The only thing I am missing is how to reference a content of the span with jscript and trigger the written jscript function. Maybe someone could help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That's not redirection of the output in my book, but I already alluded to that avenue previously. If your question is on the Javascript needed, then this thread will be moved.
Post Reply