October 7th, 2000, 12:23 AM
I have been trying to include() a file from an external host. This file contains some arrays such as; module_name, module_version, module_filename.
I need to be able to include() this file and use this data on the 'local' server. If I use a readfile(), the information is displayed in my page, so url, dns, etc are all correct. To use an include however, I get nothing. A simple sample (only module name array) follows;
echo "I am on the remote server";
$modules = array(0 => 'module 1',
1 => 'module 2',
2 => 'module 3'
Thanks in advance.
October 7th, 2000, 03:10 AM
I'm not too sure if I understand completely what you're doing, but chances are if you're include()ing the remote file eg include("http://whateverFile") then the file is being remotely executed - hence you're not getting anything back.
if the remote server is running php then it will execute what's in the <?php ?> tags before it returns it.
Please somebody correct me if i'm wrong.
October 7th, 2000, 03:17 AM
That is right I believe. The server where the include() file is does not process .php4 files, whereas the local server does. So I have tried different combinations of exensions, but still the variables referenced in the remote server script are unavailable in the local script.
October 7th, 2000, 04:13 AM
Actually I meant exactly the opposite
If the remote server IS running php, then it will execute what's in the <?php ?> tags before returning it - as far as I can tell from what you want to do, YOU DON'T WANT THAT.
If this is the case it won't return what's between the <?php ?> tags. You want it to so your "local" script can execute it and hence the variable references etc will mean something.
Once again, someone please correct me if I'm wrong as I've never actually done this.
October 7th, 2000, 09:46 AM