Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to include file from different server

    Hi,

    I have a file named file1.php in server 1,
    and another file named file2.php in server 2, I wish to include file1.php in the file file2.php. How can i do this?

    deva
    Last edited by deva.vvel; 07-12-2007 at 07:02 AM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    For security reasons this isn't possible. Otherwise I could easily read any site's PHP code and get all kinds of neato highly sensitive info.

    EDIT: That's not entirely true, I forgot about the whole http wrapper thing and the ability to "sort of" include remote PHP files. It's more like you can pass variables to the remote PHP file and get the return value from that file but it's not the same as a normal include.

    Read this page for the details:

    http://us2.php.net/manual/en/function.include.php
    Last edited by Fumigator; 07-12-2007 at 08:10 AM.

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks fumigator.. it helped me a lot..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •