#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Ballina, NSW, Australia
    Posts
    2
    Rep Power
    0
    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;

    <?php
    global $modules;
    echo "I am on the remote server";
    $modules = array(0 => 'module 1',
    1 => 'module 2',
    2 => 'module 3'
    );
    ?>

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Melbourne, Victoria, Australia
    Posts
    104
    Rep Power
    15
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Ballina, NSW, Australia
    Posts
    2
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Melbourne, Victoria, Australia
    Posts
    104
    Rep Power
    15
    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.
  8. #5
  9. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I need to be able to include() this file and use this data on the 'local' server

    Please RTFM at -> http://www.php.net/manual/html/function.include.html

Similar Threads

  1. Unable to connect to remote host: 127.0.0.1:2000
    By brettr1974 in forum Perl Programming
    Replies: 3
    Last Post: June 20th, 2008, 09:33 PM
  2. local conn to remote MySQL host blues
    By leafbreeze in forum MySQL Help
    Replies: 0
    Last Post: February 3rd, 2004, 06:01 PM
  3. Qmail done remote email@aol.com
    By service123 in forum Mail Server Help
    Replies: 1
    Last Post: December 16th, 2003, 08:58 AM
  4. how to connect postgres in remote host
    By chandar in forum PostgreSQL Help
    Replies: 7
    Last Post: December 13th, 2003, 03:58 AM
  5. Replies: 0
    Last Post: July 22nd, 2003, 09:56 AM

IMN logo majestic logo threadwatch logo seochat tools logo