quintin Posted April 22, 2007 Share Posted April 22, 2007 I've been trying to load another website in my current site through php. So that way they don't actually leave my site. I've been trying to use require_once("http://domain.com"); or include and thats not working. Is there a easy way to do this in php. I've been trying to look on how to do this and all that i've found is wordwrap (i think it was called) which I couldn't get to work. Thanks Link to comment https://forums.phpfreaks.com/topic/48092-view-external-website/ Share on other sites More sharing options...
genericnumber1 Posted April 22, 2007 Share Posted April 22, 2007 you could do <?php echo file_get_contents('http://domain.com/'); ?> But the problem with this is links, images, etc wouldn't work because of the way the links in their html is usually formatted. (The browser would look for the images, links, etc on YOUR domain.) To fix this you have three options... 1) Parse all the contents of their web page for all the link possibilities and reformat them correctly to link to their domain (a lot of work, a memory/bandwidth hog.) 2) Parse all the contents of their web page for all the link possibilities and reformat them to also tunnel through your server the same way the page being parsed is (a lot of work, even bigger memory/bandwidth hog... but this is how proxies work.) 3) Use an iframe (easy! cheap!) Link to comment https://forums.phpfreaks.com/topic/48092-view-external-website/#findComment-235033 Share on other sites More sharing options...
quintin Posted April 22, 2007 Author Share Posted April 22, 2007 Ok, the Iframe sounds like a good idea so i decided to give it a try. I can get it to work with a standar suffix (.com, .org,...) but when i try the site im trying http://www.rentors.org/calendar.cfm?pid=43035 it won't work. The site I have the site being tested right now at http://www.fastvacationrentals.com/oregon/honalee/availability.php (may or may not work depending on the time your looking at since I'm working on it as we speak). Any ideas. I'll try to figure it out, but hopefully it'll still work. Heres the code that I have. if i put google.com or another site in it works fine but not with this. By the way its inside php thats why there is the \'s. echo"<iframe src=\"http://www.rentors.org/calendar.cfm?pid=43035\" width='500' height='500'></iframe>"; Thanks Link to comment https://forums.phpfreaks.com/topic/48092-view-external-website/#findComment-235066 Share on other sites More sharing options...
quintin Posted April 22, 2007 Author Share Posted April 22, 2007 Never mind. I remember having the same problem as I did in this one. With the ? and ='s in URL . Thanks for the help guys Link to comment https://forums.phpfreaks.com/topic/48092-view-external-website/#findComment-235072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.