I'm including a website as an iFrame but I want to use PHP instead. The problem is, when you use the code below, the links within the external website cause the user to launch out of your website. In an iframe, when you click the links, everything stays within your website. Is there anyway to have this typical iframe behaviour using PHP? <?php include("http://www.URL-to-my-shop.com") ?> Code (markup):
First off you should change your code to file_get_contents instead of include for security reasons. Second, why won't you use an iframe? For what reason?
php include is used to include other php files whose functions are required in the current php file It will not act like a iframe substitute IMO
Thanks guys, looks like I'm stuck with iFrames if you say I can have the pages that are linked stay within my website like an iFrame. The main reason I don't want to use an iFrame is the delay you get when it loads, I've tried using php instead and there is no delay, it's as if it's part of your own website.
If you use file_get_contents, you will also get the <html><body> tags, which would screw up your markup if you're including it in the middle of an existing page. Also, DON'T use iFrames. Using iFrames is like programming HTML layouts with tables. It's cave-men web programming.