I figure this might be a fun challenge to some of you out there...
I appreciate all the help. Thanks in advance.
Here we go...
I have 2 web page (on different servers) I am working on. Here, we'll call them Page-A and Page-B.
I want to save some work by only having to maintain 1 web page and the changes made to source page will get reflect onto the other one. In this case, Page-A is the source and Page-B should just have a content grabbing PHP script.
I thought of using ob_get_contents(); grabbing Page-A's HTML code and insert them into Page-B. However, doing that means I will have to create a whole mirror set of files+images on both Page-A's server and Page-B's server.
Since Page-A has both links to other domains (absolute URLs) and links to local page/files (relative URLs). The codes needed here will have:
1. A way to find all the URLs on Page-A
2. Determine if it is a relative URL or absolute URL:
3a. If it is an absolute URL, Page-B just go ahead and grab that URL,
3b. If it is a relative link, Page-B will have to convert that link into absolue URL (adding Server-B's domain name to the URL).