Forum Moderators: open

Message Too Old, No Replies

open link in iframe on another page

         

pixelmeister

2:00 pm on Oct 17, 2004 (gmt 0)

10+ Year Member



Hi all,

I have a problem that i hope someone here can help me with:
I have some links on my index page. I want those links to open another page and load the link into an iframe on that page.

I hope you can understand what i want to achieve.

Regards
Pixelmeister

<Sorry, no personal URLs. See TOS [webmasterworld.com]>

[edited by: tedster at 4:17 pm (utc) on Oct. 17, 2004]

tedster

5:21 pm on Oct 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do many of these links open the same new parent page, but each link asks for a different document in the iframe?

If that is the situation, you will need to create a different version of the parent document for each link, so you can use a different src attribute in the <iframe> tag. You can either do that two ways

1. Have several different parent pages (the 'pure' html solution)
2. Have one new parent page, and then use javascript document.write() to catch a variable that you pass and write the iframe src= attribute.

NOTE: The javascript logic would be very much like this post about regular frames:
Force Many Pages Into Frames [webmasterworld.com] (Message #21)

pixelmeister

6:09 pm on Oct 17, 2004 (gmt 0)

10+ Year Member



Thanks for your answer.
The problem is that the links on my index page is generated from phpclassifieds ads, i have the 5 latest ads displayed on my index page.
Phpclassifieds is in a iframe on ads.html, so i want the link on my index page to open ads.html and then open the relevant ad in the iframe on ads.html.
I don't know if this can be done.

Regards
pixelmeister

tedster

8:13 pm on Oct 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There may be a straight php solution - I can't say because I'm still a php-newbie.

But the idea is that each home page link should be generated with a query string attached. And that query string holds the url that ads.html should write into the iframe.