Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include remote file

Status
Not open for further replies.

Jiminald

Programmer
Oct 11, 2006
39
GB
Hi,

I'm trying to call a script on an internal server for my intranet. It returns a value in a function. Both pages on both servers work ok. But I cannot get the file on the second server working on the first.

TIA :)
 
What version of PHP do you have? Some older Windows versions wont allow inclusion of remote files.


Have a read at the entry for the include function at php.net. It has several warnings about remote files. Click on the funtion name for the link.

[blue]include()[/blue]


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
My primary box is Debian PHP 5.2.1 and the secondary is Windows 2003 PHP 5.1.6

I did have a read, and have also tried fopen and get_file_contents.
 
what protocol are you trying to use? is there any code you can let us see?
 
trying to use http

I have tried
include 'http://[server]/remotescript.php';
 
be aware that this will give you the output that the browser would receive if going to that page. is that what you intend, or are you looking for the source code? if the latter then the easiest solution is to use the file:// protocol or ftp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top