Embed an External Page Without an Iframe?

6 replies
  • WEB DESIGN
  • |
i need embed external site without iframe i don"t find any code work for me ..if one genies here ans my questions

i appreciate it..
#embed #external #iframe #page
  • Profile picture of the author Valdor Kiebach
    This seems to work in Firefox:
    Code:
    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <title></title>
    </head>
    <body>
    <object data=http://www.othersite.com width="820" height="450">
    <embed src=http://www.othersite.com width="820" height="450">
    </embed> Error: Embedded data could not be displayed. </object>
    </body>
    </html>
    {{ DiscussionBoard.errors[8206852].message }}
    • Profile picture of the author Brandon Tanner
      Another option (one which will work in all browsers) is to grab the source code of the external page and echo it out using PHP...

      PHP Code:
      <?php
      echo file_get_contents("http://www.ExternalPage.com");
      ?>
      ^ A couple potential drawbacks to that method though...

      1) If the external site uses relative links in its source code, those links won't work (although there is a workaround to that if it's worth it to you, by using str_replace to make all the links absolute).

      2) Echoing 'file_get_contents' from an external URL presents a security risk, because if the owner of the external site ever puts malicious code on the page that you're echoing, that code will be injected directly into your page. The chances of that happening are slim, but just be aware that it is possible.
      Signature

      {{ DiscussionBoard.errors[8207091].message }}
  • Profile picture of the author vipanil7
    sir thing is when i try to load flickr dot com it not loading that what i trying do
    {{ DiscussionBoard.errors[8214598].message }}
  • Profile picture of the author lucila
    If the other webpage doesn't contain any form or text, for example you can use the CURL method to pickup the exact content and after then showing on your page. YOu can do it without using an iframe.

    But, if the page what you want to embed contains for example a form it will not work correctly , because the form handling is on that site.
    {{ DiscussionBoard.errors[8216498].message }}
    • Profile picture of the author vipanil7
      can i have Example so that i can understand it better ...
      {{ DiscussionBoard.errors[8217622].message }}
      • Profile picture of the author Brandon Tanner
        Originally Posted by vipanil7 View Post

        can i have Example so that i can understand it better ...
        OK... since you ignored my advice from the other thread, then maybe this code will make more sense to you...

        PHP Code:
        <?php echo "Stop trying to frame sites that don't want to be framed!!!!"?>
        Seriously though, read this...

        http://www.flickr.com/help/blogging/...=frame#1392237
        Signature

        {{ DiscussionBoard.errors[8217897].message }}

Trending Topics