PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am having trouble including a file from another server. I have permission from a news site to include there news script, but when I try to include it, it doesn't work.
Local includes are OK, but not from external sites. I have tried changing the php.ini file but cannot seem to get the settings right. Am I missing something?
If "URL fopen wrappers"
are enabled in PHP (which they are in the default configuration),
you can specify the file to be included using an URL (via HTTP or
other supported wrapper - see Appendix I for a list
of protocols) instead of a local pathname. If the target server interprets
the target file as PHP code, variables may be passed to the included
file using an URL request string as used with HTTP GET. This is
not strictly speaking the same thing as including the file and having
it inherit the parent file's variable scope; the script is actually
being run on the remote server and the result is then being
included into the local script.
PHP Man Page - include() wrote:Windows versions of PHP prior to PHP 4.3 do not support accessing remote files via this function, even if allow_url_fopen is enabled.