SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: iFrame

Hybrid View

  1. #1
    SitePoint Enthusiast jturner's Avatar
    Join Date
    Jun 2004
    Location
    Phx
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iFrame

    Does anyone know how to open a link in an iFrame in the parent window if the framed page is not in the same domain?

  2. #2
    SitePoint Zealot My220x's Avatar
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess some sort of JavaScript.

  3. #3
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty sure it's NOT possible, strictly because it's more secure. You wouldn't want an external domain messing around with your page, this is usually limited by browsers.
    Cross browser css bugs

    Dan Schulz you will be missed

  4. #4
    SitePoint Enthusiast jturner's Avatar
    Join Date
    Jun 2004
    Location
    Phx
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about something server-side?

  5. #5
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you're asking, I'm afraid is pretty much impossible. I've only seen frame interaction where the frame generated was from the domain that opened it. I'm not sure what you would be able to do server-side wise, because server-side code just outputs front end code and you still won't be able to access that parent window.
    Cross browser css bugs

    Dan Schulz you will be missed

  6. #6
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    How would you make a server-side IFRAME?
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  7. #7
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    How would you make a server-side IFRAME?
    Maybe something like this ?

    HTML Code:
    <a href="?file=link1"> link 1</a>
    <a href="?file=link2"> link 2</a>
    <a href="?file=link3"> link 3</a>
    PHP Code:

    <?php

    $file 
    $_GET['file']; 
    if (empty(
    $file)){ 
    $file "welcome.php";
    } else{ 
    $file $file .".php"


    $iframe "<iframe src=\""$file ."\" width=\"100%\" height=\"300px\"> ";
    $iframe .= "<p>Your browser does not support iframes.</p> ";
    $iframe .= "</iframe> "

    echo 
    $iframe 

    ?>

  8. #8
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bulevardi View Post
    Maybe something like this ?

    HTML Code:
    <a href="?file=link1"> link 1</a>
    <a href="?file=link2"> link 2</a>
    <a href="?file=link3"> link 3</a>
    PHP Code:

    <?php

    $file 
    $_GET['file']; 
    if (empty(
    $file)){ 
    $file "welcome.php";
    } else{ 
    $file $file .".php"


    $iframe "<iframe src=\""$file ."\" width=\"100%\" height=\"300px\"> ";
    $iframe .= "<p>Your browser does not support iframes.</p> ";
    $iframe .= "</iframe> "

    echo 
    $iframe 

    ?>
    You do know that php outputs html... and the original poster has an html iframe, what you just echo'd is the same as he already has!
    Cross browser css bugs

    Dan Schulz you will be missed

  9. #9
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    You do know that php outputs html... and the original poster has an html iframe, what you just echo'd is the same as he already has!
    That was my purpose

    As a reply on C. Ankerstjerne who wanted to see that html iframe generated by php

  10. #10
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bulevardi View Post
    That was my purpose

    As a reply on C. Ankerstjerne who wanted to see that html iframe generated by php
    I'm positive he knows and is familiar with how server-side languages work ( he is knowledgeable ). I think he meant to say how could you use server-side to solve this problem instead of how to generate an iframe using a server-side language, which gives you the exact same result meaning we're at the same point and haven't progressed further
    Cross browser css bugs

    Dan Schulz you will be missed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •