user2671438
user2671438

Reputation: 1

Keeping a link inside a iframe

I am trying to use Iframes and or PHP to hide a link that is dynamically created. The link is being created in php. But when I try to access that link from within an iframe it takes over the whole page. The site loads, but the idea is that if it was in an iframe the url could be hidden and the user could click multiple items with out having to enter all their form data in every time.

I've tried using the link as a header and using php commands like: $remote = fopen( $URL, "r");fpassthru($remote); where $URL was my link.

a sample of the link is: http://fb-zc-0.cafe.zynga.com/current/iframe//mfs_sent.php?ids=2&tab_clicked=All&request_id=236973056431070&gid=3014&today=1&time=3&ref=gift_today&cafe_token=OAlF7gSlMbQxAtBhvnprTzNhIww8H7Aq2z9i3KJwGWmJzUQfxZ8b9/kFWMVqN62JUihQA06VtuuoKoxmosK6JIPKWTMl0oQecLb+0e0HSAk3S32f5BCI7xhYB9SflOnN&from_page=SUNRISE_BREAKFAST_1&kingdom=quest&phylum=baklava&uid=342&sendkey=8e4aa1a75594c47cc61aee301efff90e$$ccF(NUP,67jiH3QM7!nspE0W8d8KprzD5,Za77bp34G*S_ST)*ilx)F7Y)acC4xj971Kkswxx2OM3eij3z1h0M3eij3z1h0&mode=quest_asking&quest_key=SUNRISE_BREAKFAST_1&mfs_time=3&snood=1&ajax=true&limiter_channel=rsvp&limiter_type=build_a_carnival3+5

Any help would be appreciated.

Upvotes: 0

Views: 373

Answers (1)

Zz Oussama
Zz Oussama

Reputation: 229

If you have links outside of this iFrame and want them to load into that iFrame on the same page, you'll have to give it a name, then target the named iFrame within your link's href.

<iframe src="http://google.com" name="myframe" hieght="100" width="100"></iframe>
<br/>
<a href="http://reddit.com" target="myframe">Test</a>.

However, if you're loading a page into your iFrame that's loading links with target="blank", then those will go to a new window; unless you don't have access to those pages, you won't be able to change the links (short of writing JS to dive into your iFrame, etc).

Upvotes: 1

Related Questions