View Full Version : php include using files from another server
12-10-2008, 09:32 PM
I use includes all the time within my php files. The problem I am having is that I want to do an include of a file that on another server (different domain), and it doesn't seem to let me. Is there something I need to do on my end, or something that the remote server manager needs to do, or both?
Help is greatly appreciated. Thank you.
12-10-2008, 11:44 PM
Read this from the manual:
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see List of Supported Protocols/Wrappers 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 a 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.
Also check this link out, it contains an example that may be a better option for your purposes:
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.