Do most hosts allow remote file inclusion?

Posted by admin
Remote File Back Up
mzanime2000 asked:


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

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

3 Responses to “Do most hosts allow remote file inclusion?”

  1. Jim Says:

    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.

  2. K-Disk.com Says:

    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.

  3. just "JR" Says:

    The same domain you can have link to them.