Can one in Php load an include file from another Web site


Say I have a file test.php which is on web site.

Can this file have in it an include file like this:
include ‘’;

I guess the answer is not, since I am getting Error message that the function that I want in is not defined in test.php of web site, but I just to double check
and make sure there is no way around this.


Depending on your settings you may be able to grab it with [fphp]file_get_contents/fphp – but presumably you want to run the contents of that file through the parser?

I’d consider using wget or cURL to fetch the file – store it on my own server at set intervals maybe – as long as you are totally and absolutely sure that file can never, ever contain anything bad.


So the answer is that php pages on cannot load php pages on via include command.
And both of these servers our, so no it wont contain anything bad.


It would be different if both domains were the same machine.

yes …until your server allows remote file include which is set in your server php.ini settings…
fopen and remote file include setting

but if you are including file of site a and it goes down
you may get fatal error in your site…so be careful

Ok, ThanX.