I'm experimenting with the Postnuke CMS (www.postnuke.com), and have written a script that includes local html, php or txt files in the site, which includes a header with graphics and menus, a side-menu, anda footer, with the file to be included in the middle. This all works great, but I thought of extending it to be able to include external web pages in the site without resorting to framesets. The only other scripts available that does this use the IE-specific iframe tag, which tends to look ugly with scrollbars on the side and bottom, and having to scroll sideways constantly to read content. I also want a standards-compliant approach. I'd like the script to be portable, so prefer not to use Apache-specific functions, but it would be OK if it did, as I'd simply state that fact.
I've tried all the usual suspects, include(), readfile(), fgets(), and curl, but they all have the same problem. Whereas I can output the HTML fine embedded in the site, all links to images and stylesheets etc are broken due to the links being relative to MY server directories, NOT the origin server. Only by using a frameset and something like header('location:......') in the middle frame will it work. Obviously I can't do that in the middle of a page with no frames. I can't find good documentation on libcurl to see if IT has something.
So, how do I simply display a remote webpage without breaking the links? Is there a function to tell it to look relative to the origin server, not the local filesystem? Maybe by changing the Header data or something?