Avatar of Dada44
Dada44
Flag for Spain

asked on 

Iframe shows content depending on parameters in url of parent window


Hi all,

I have to put an iframe inside a php page. The iframe has to show a different content page depending on the parameters in the url of the php parent page.

Let's approach it with an example:

Imagine the parent window's url is:

http://www.server.com/index.php?id=anid&Month=3&Year=2009

For Month=3 and Year=2009 the iframe inside index.php should be something like:

<iframe src="http://www.another_server.com/page_showing_content_for_march2009.php"></iframe>

If the parent window's url is:

http://www.server.com/index.php?id=anid&Month=4&Year=2010

For Month=4 and Year=2010 the iframe inside index.php should be something like:

<iframe src="http://www.another_server.com/page_showing_content_for_april2010.php"></iframe>
and so on ...

Of course

page_showing_content_for_march2009.php
and
page_showing_content_for_april2010.php
have to be in the end (inside of the iframe) just one dynamic page called page_showing_content.php that changes depending on the parameters in the url.

How can I do the whole thing???

Thanks a ton in advance!!

PHPJavaScript

Avatar of undefined
Last Comment
Dada44

8/22/2022 - Mon