tags:

views:

60

answers:

2

I just saw joomla's built in component, the wrapper (or was that a module, can't recall). IT is a page where you can show another website(while being in your site). What is the logic behind this? Any suggestions on how to implement this in PHP (I don't know where to start)?

+1  A: 

I'm pretty sure you don't need any PHP for this, just an <iframe>:

<iframe src="http://google.com/"&gt;&lt;/iframe&gt;
Jordan
Bleh. There is only one website I've ever found that implements `<iframe>`s in a useful way: Gmail. Mainly because they use it to allow the application to refresh less.
Chacha102
That statement of course extends to most of the Google Applications, BTW
Chacha102
Nevertheless, this is undoubtedly the method the Joomla component in question uses.
Jordan
A: 

Instead of an iframe you could make your website act as some kind of proxy, for example with file_get_contents(). After retrieving the contents you could modify the links to point at your page and send along the url, for example proxy.php?url=http://something.com. Note however that there are several security issues involved in this, as you don't have any control over the content that is displayed to the user. Therefore I would not recommend this approach unless you implement some kind of URL whitelist and block all other URLs.

phidah