I have created a web-based tool that takes users through a series of pages and presents them with their results on a results page. It relies on databases stored on my server, and currently resides on my own dedicated server.
I will be licensing the tool to another company to have it be accessible on their website, for their customers to use. I need to be able to edit the code from time to time to keep the tool up to date. Thus, I need to basically include my program's pages (steps) on their server, while keeping the databases and pages on my server (they're many many gigabytes in size). I have an idea of the solution, but don't know if it's possible:
--create all of the pages on their server with only headers and footers (blank space in body)
--Add one include() statement in the body of each page to pull my content from my server into their pages.
--Make calls to my databases for the queries
Is it possible to use include() to pull files from a different server? Also, can I pull database queries from another server? If anyone has a better solution, please let me know. It would be VERY beneficial not to have to physically place my pages on their website, as the tool will be licensed to as many as 100 companies, and I don't want to have to update each company's website every time I change something.
Possible to include files from my server on another?
Moderator: General Moderators
- Jaxolotl
- Forum Contributor
- Posts: 137
- Joined: Mon Nov 13, 2006 4:19 am
- Location: Argentina and Italy
From Manual http://www.php.net/include
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 Appendix O, 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.