Global Includes?

Discussion in 'PHP' started by Keagle, May 12, 2007.

  1. #1
    What are they? Are they like includes - but you can use them remotely? If so, could you give me an example?

    If not, how would I go about doing this:

    Say I had 3 sites, www.a.com www.b.com www.c.com and I wanted all of them to have the same text for a variable, and I could edit it via one file.

    Like an include, but for three sites.

    Thanks,
    Keagle
     
    Keagle, May 12, 2007 IP
  2. Subikar

    Subikar Active Member

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Ad those three site in a file
    Say filename glopal.php
    include("www.a.com");
    include("www.a.com");
    include("www.a.com");

    And then add that file to the required file you want.
     
    Subikar, May 12, 2007 IP
    Keagle likes this.
  3. Keagle

    Keagle Peon

    Messages:
    351
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you! :)
     
    Keagle, May 12, 2007 IP
  4. grandpa

    grandpa Active Member

    Messages:
    185
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    75
    #4
    if you want them to read the variable inside the php file, your 3 domain have to run in the same server!

    if you just need to read the output, you can use echo file_get_contents("http://domain.com/something.php");
     
    grandpa, May 14, 2007 IP