Hello. I have the following include that works just fine: <?php include("news.html"); ?> PHP: But when I try to include from another one of my sites, on a different domain, it doesnt work. Here is the sample code: <?php include('http://www.mysite.com/news.html'); ?> PHP: Am I using the right code to grab the html from a diff domain? Thanks in advance.
You can use include() only locally. If you need only the content of the file you include, you can try this echo file_get_contents('http://www.mysite.com/news.html'); PHP:
not true: it depends on a setting in the php.ini file, named allow_url_fopen if it is set to 'On', you can include external scripts (i use it all the time). Some host companies turn it off, don't really now why, but wth
Thanks for everyone's input. OK, here is the tough part. I have successfully included html from another domain. Now within that html file, I would like to include several pages. Why? I am providing hosting in a niche market and need to automatically update their site each month with this very specific content provided by me. I dont know databses so this is the only way I can think to do it. Does this make sense? Thanks in advance.
change the extension from the html page to php, and use the same include function to include the other pages.