Do most hosts allow remote file inclusion?
Posted by admin
mzanime2000 asked:
For example, lets say put something like this in my PHP code:
For example, lets say put something like this in my PHP code:
Thanks all who answered, I think I found a better solution. Opinions?
$file = fopen ("http://www.domain.com/path/to/file.html", "r");
if (!$file) {
echo "
Unable to open remote file.\n”;
exit;
}
while (!feof ($file)) {
$page = fgets ($file, 1024);
echo $page;
}
fclose($file);
?>
Btw, I’m pretty sure the remote site will give us permission, because they already gave us the “OK” to use their content in an iframe… but that kinda sucks.
Joe








January 5th, 2009 at 5:07 pm
If that external site is not controlled by you, then that’s a really horrible idea. You’d be opening yourself up to some external site injecting whatever content & possibly code into your own content.
January 7th, 2009 at 6:34 pm
The php include can only be used to include files on the webserver you are running it on the php include can only be used to include files on the php include can only be used.
The webserver you are running it on the webserver you are running it on the webserver you are running it on the webserver you are running it on the webserver you are running it on the webserver you are running it on the php include can only be used to include.
January 10th, 2009 at 3:38 pm
The same domain you can have link to them.