Hello,

My ultimate goal is to be able to utilize common PHP header and footer files between 2 different domains hosted on 2 diffrent servers.

  1. Is this possible or is there something in PHP or Servers in general that prevents this?

  2. I have a few ideas for this. Is there anything that is wrong with these that won't work?
    a) Utilize the header() function within PHP. As of writing this, I have not tested this.
    b) Utilize a common database and utilize a reference this. However, I believe this would cause me to have to host the same exact CSS and pictures on both servers which in that case I should just utilize option C.
    c) Use PHP FTP in order to create a synchronization between the two servers every hour. If something is not found on the one domain, it automatically updates to the next domain. This will host all CSS files, images, etc utilized within the header and footer files on both domains however will cause a synchronization between the two so I only need to update domain which is the ultimate goal.

Is there another way that is easier than what I have thought out?

Thanks,

Wayne

    If your aim is to share data, then a common database sounds reasonable. Of course, each website can continue to have its own private database as well.

    If your aim is to keep source files synchronised, then perhaps you should use the appropriate software like rsync. (I am not clear of the details.)

      I have around 5 PHP files that are hosted on Domain A.
      Domain B is almost a duplicate of Domain A utilizing the same framework (ie. links, headers, footers) except for the main content (ie. text, images, etc).

      When I make a change to the header on Domain A, I would prefer it if the change was made on Domain B as well without having to ftp to Domain B and upload the new file to that as well.

      I am attempting to utilize the same header and footer files utilized on Domain A for Domain B.

      Will RSync do that? I found Scriptol and apparently it has an AutoSync FTP Function. I am looking into whether or not I can have it scan the files, see if anything has changed and upload it. That is not very effecient however it is still semi-automated. I would rather a better solution.

      Thanks,

      Wayne

        scrfix wrote:

        I have around 5 PHP files that are hosted on Domain A.
        Domain B is almost a duplicate of Domain A utilizing the same framework (ie. links, headers, footers) except for the main content (ie. text, images, etc).

        When I make a change to the header on Domain A, I would prefer it if the change was made on Domain B as well without having to ftp to Domain B and upload the new file to that as well.

        I am attempting to utilize the same header and footer files utilized on Domain A for Domain B.

        Will RSync do that? I found Scriptol and apparently it has an AutoSync FTP Function. I am looking into whether or not I can have it scan the files, see if anything has changed and upload it. That is not very effecient however it is still semi-automated. I would rather a better solution.

        Thanks,

        Wayne

        Heres a long shot...

        In Header A

        // make sure that nobody can get source exept domain b
        if($SERVER['REMOTE_ADDR'] == 'doman.b.ip.addy')
        {
        echo file_get_contents($
        SERVER['PHP_SELF']);
        die();
        }

        In Header B

        $header_a = file_get_contents("http://headera.com/header.php");
        eval($header_a);

          OR

          have header a stat itself and save the mtime value in a file or in header a's database. Then have header a re'stat itself every time it loads and automatically upload itself to domain b if the stat values are different (ie it has been modified), and update the mtime value with the current stat['mtime']

            Write a Reply...